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 af8a88d8f26e..bbbdda02a5f3 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,10 +25,7 @@ from azure.ai.ml._restclient.v2020_09_01_dataplanepreview import ( AzureMachineLearningWorkspaces as ServiceClient092020DataplanePreview, ) -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 -from azure.ai.ml._restclient.v2023_06_01_preview import AzureMachineLearningWorkspaces as ServiceClient062023Preview 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 @@ -105,6 +102,9 @@ 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") +ServiceClient102022Preview = partial(MachineLearningServicesMgmtClient, api_version="2022-10-01-preview") +ServiceClient022023Preview = partial(MachineLearningServicesMgmtClient, api_version="2023-02-01-preview") +ServiceClient062023Preview = partial(MachineLearningServicesMgmtClient, api_version="2023-06-01-preview") ServiceClient012025Preview = partial(MachineLearningServicesMgmtClient, api_version="2025-01-01-preview") ServiceClient102024PreviewTsp = partial(MachineLearningServicesMgmtClient, api_version="2024-10-01-preview") diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/__init__.py deleted file mode 100644 index da46614477a9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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_10_01_preview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_azure_machine_learning_workspaces.py deleted file mode 100644 index d3c92e8135bc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,233 +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, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, JobsOperations, LabelingJobsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, 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 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 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_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 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 labeling_jobs: LabelingJobsOperations operations - :vartype labeling_jobs: azure.mgmt.machinelearningservices.operations.LabelingJobsOperations - :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 - :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 "2022-10-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.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.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_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.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.labeling_jobs = LabelingJobsOperations(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) - - - 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_10_01_preview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_configuration.py deleted file mode 100644 index f395f71d01fe..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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 "2022-10-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', "2022-10-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/v2022_10_01_preview/_metadata.json b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_metadata.json deleted file mode 100644 index 4cfc8980fa02..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_metadata.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "chosen_version": "2022-10-01-preview", - "total_api_version_list": ["2022-10-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", - "registries": "RegistriesOperations", - "workspace_features": "WorkspaceFeaturesOperations", - "registry_code_containers": "RegistryCodeContainersOperations", - "registry_code_versions": "RegistryCodeVersionsOperations", - "registry_component_containers": "RegistryComponentContainersOperations", - "registry_component_versions": "RegistryComponentVersionsOperations", - "registry_environment_containers": "RegistryEnvironmentContainersOperations", - "registry_environment_versions": "RegistryEnvironmentVersionsOperations", - "registry_model_containers": "RegistryModelContainersOperations", - "registry_model_versions": "RegistryModelVersionsOperations", - "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", - "labeling_jobs": "LabelingJobsOperations", - "model_containers": "ModelContainersOperations", - "model_versions": "ModelVersionsOperations", - "online_endpoints": "OnlineEndpointsOperations", - "online_deployments": "OnlineDeploymentsOperations", - "schedules": "SchedulesOperations" - } -} \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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_10_01_preview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_vendor.py deleted file mode 100644 index 138f663c53a4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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_10_01_preview/_version.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_version.py deleted file mode 100644 index eae7c95b6fbd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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_10_01_preview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/__init__.py deleted file mode 100644 index f67ccda966f1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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_10_01_preview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_azure_machine_learning_workspaces.py deleted file mode 100644 index bd38eaf1f3d9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,230 +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, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, JobsOperations, LabelingJobsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, 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 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 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_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 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 labeling_jobs: LabelingJobsOperations operations - :vartype labeling_jobs: - azure.mgmt.machinelearningservices.aio.operations.LabelingJobsOperations - :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 - :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 "2022-10-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.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.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_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.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.labeling_jobs = LabelingJobsOperations(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) - - - 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_10_01_preview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_configuration.py deleted file mode 100644 index dde99f5c7bff..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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 "2022-10-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', "2022-10-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/v2022_10_01_preview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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_10_01_preview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/__init__.py deleted file mode 100644 index 01fa2d886d14..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/__init__.py +++ /dev/null @@ -1,85 +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 ._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_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 ._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 ._labeling_jobs_operations import LabelingJobsOperations -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 - -__all__ = [ - 'Operations', - 'WorkspacesOperations', - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'WorkspaceConnectionsOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'JobsOperations', - 'LabelingJobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_deployments_operations.py deleted file mode 100644 index 1483c2fe2ca7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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', "2022-10-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', "2022-10-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, **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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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, **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/v2022_10_01_preview/aio/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_endpoints_operations.py deleted file mode 100644 index a31ef8ddd428..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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', "2022-10-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', "2022-10-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, **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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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, **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', "2022-10-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/v2022_10_01_preview/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_containers_operations.py deleted file mode 100644 index 51250fad9f43..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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/v2022_10_01_preview/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_versions_operations.py deleted file mode 100644 index 6470da292155..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_versions_operations.py +++ /dev/null @@ -1,366 +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_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 - """ - api_version = kwargs.pop('api_version', "2022-10-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, - 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, - 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', "2022-10-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', "2022-10-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', "2022-10-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_containers_operations.py deleted file mode 100644 index acbc0fe6d2a6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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/v2022_10_01_preview/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_versions_operations.py deleted file mode 100644 index d3dbca43c2b8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_versions_operations.py +++ /dev/null @@ -1,371 +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_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 - """ - api_version = kwargs.pop('api_version', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_compute_operations.py deleted file mode 100644 index bf8c25a14d65..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_compute_operations.py +++ /dev/null @@ -1,1209 +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_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_custom_services_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: - """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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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 - - - 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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_containers_operations.py deleted file mode 100644 index 431836783f5f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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/v2022_10_01_preview/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_versions_operations.py deleted file mode 100644 index 36293053cf04..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_versions_operations.py +++ /dev/null @@ -1,380 +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_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 - """ - api_version = kwargs.pop('api_version', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_datastores_operations.py deleted file mode 100644 index 4599f14170cc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_datastores_operations.py +++ /dev/null @@ -1,438 +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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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, - **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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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, - name=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('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_10_01_preview/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_containers_operations.py deleted file mode 100644 index 774d9f5bdf4d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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/v2022_10_01_preview/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_versions_operations.py deleted file mode 100644 index d5d425464fa6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_versions_operations.py +++ /dev/null @@ -1,371 +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_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 - """ - api_version = kwargs.pop('api_version', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_jobs_operations.py deleted file mode 100644 index 70edbcfcf4b2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,542 +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, - 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 - """ - api_version = kwargs.pop('api_version', "2022-10-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, - 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, - api_version=api_version, - 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( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=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', "2022-10-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', "2022-10-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, **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', "2022-10-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. - - 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.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', "2022-10-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', "2022-10-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', "2022-10-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/v2022_10_01_preview/aio/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_labeling_jobs_operations.py deleted file mode 100644 index c29db25275c4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_labeling_jobs_operations.py +++ /dev/null @@ -1,739 +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._labeling_jobs_operations import build_create_or_update_request_initial, build_delete_request, build_export_labels_request_initial, build_get_request, build_list_request, build_pause_request, build_resume_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class LabelingJobsOperations: - """LabelingJobsOperations 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, - **kwargs: Any - ) -> AsyncIterable["_models.LabelingJobResourceArmPaginatedResult"]: - """Lists labeling jobs in the workspace. - - Lists labeling 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 count: Number of labeling jobs to return. - :type count: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LabelingJobResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 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, - 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, - 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("LabelingJobResourceArmPaginatedResult", 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}/labelingJobs"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - """Delete a labeling job. - - Delete a labeling 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 LabelingJob. - :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', {})) - - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - - - request = build_delete_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.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}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - id: str, - include_job_instructions: Optional[bool] = False, - include_label_categories: Optional[bool] = False, - **kwargs: Any - ) -> "_models.LabelingJob": - """Gets a labeling job by name/id. - - Gets a labeling 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 LabelingJob. - :type id: str - :param include_job_instructions: Boolean value to indicate whether to include JobInstructions - in response. - :type include_job_instructions: bool - :param include_label_categories: Boolean value to indicate Whether to include LabelCategories - in response. - :type include_label_categories: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LabelingJob, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJob - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2022-10-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, - include_job_instructions=include_job_instructions, - include_label_categories=include_label_categories, - 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('LabelingJob', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.LabelingJob", - **kwargs: Any - ) -> "_models.LabelingJob": - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'LabelingJob') - - request = build_create_or_update_request_initial( - 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_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('LabelingJob', 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('LabelingJob', 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}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.LabelingJob", - **kwargs: Any - ) -> AsyncLROPoller["_models.LabelingJob"]: - """Creates or updates a labeling job (asynchronous). - - Creates or updates a labeling 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 LabelingJob. - :type id: str - :param body: LabelingJob definition object. - :type body: ~azure.mgmt.machinelearningservices.models.LabelingJob - :keyword callable cls: A custom type or function that will be passed the direct response - :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 LabelingJob or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2022-10-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.LabelingJob"] - lro_delay = kwargs.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, - id=id, - 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('LabelingJob', 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}/labelingJobs/{id}"} # type: ignore - - async def _export_labels_initial( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.ExportSummary", - **kwargs: Any - ) -> Optional["_models.ExportSummary"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExportSummary"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ExportSummary') - - request = build_export_labels_request_initial( - 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._export_labels_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('ExportSummary', 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 - - _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - - @distributed_trace_async - async def begin_export_labels( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.ExportSummary", - **kwargs: Any - ) -> AsyncLROPoller["_models.ExportSummary"]: - """Export labels from a labeling job (asynchronous). - - Export labels from a labeling 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 LabelingJob. - :type id: str - :param body: The export summary. - :type body: ~azure.mgmt.machinelearningservices.models.ExportSummary - :keyword callable cls: A custom type or function that will be passed the direct response - :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 ExportSummary or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2022-10-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.ExportSummary"] - lro_delay = kwargs.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._export_labels_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - 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('ExportSummary', 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_export_labels.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - @distributed_trace_async - async def pause( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - """Pause a labeling job. - - Pause a labeling 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 LabelingJob. - :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', {})) - - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - - - request = build_pause_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.pause.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, 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, {}) - - pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - - - async def _resume_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', "2022-10-01-preview") # type: str - - - request = build_resume_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._resume_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) - - _resume_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore - - - @distributed_trace_async - async def begin_resume( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Resume a labeling job (asynchronous). - - Resume a labeling 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 LabelingJob. - :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', "2022-10-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._resume_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_resume.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_containers_operations.py deleted file mode 100644 index 5013a222b365..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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/v2022_10_01_preview/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_versions_operations.py deleted file mode 100644 index 1f9f681bbfac..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_versions_operations.py +++ /dev/null @@ -1,403 +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_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 - """ - api_version = kwargs.pop('api_version', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_deployments_operations.py deleted file mode 100644 index a880752577b2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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', "2022-10-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', "2022-10-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, **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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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, **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', "2022-10-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', "2022-10-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/v2022_10_01_preview/aio/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_endpoints_operations.py deleted file mode 100644 index e8333e8beee5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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', "2022-10-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', "2022-10-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, **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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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, **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', "2022-10-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', "2022-10-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', "2022-10-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 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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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/v2022_10_01_preview/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_operations.py deleted file mode 100644 index 4b016ee8371c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_operations.py +++ /dev/null @@ -1,117 +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.AmlOperationListResult"]: - """Lists all of the available Azure Machine Learning Services 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 AmlOperationListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlOperationListResult"] - error_map = { - 401: ClientAuthenticationError, 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("AmlOperationListResult", 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/v2022_10_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index 023c936ebc7c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,325 +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"]: - """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 - """ - api_version = kwargs.pop('api_version', "2022-10-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( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - 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) - - else: - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - 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("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 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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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, - 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', {})) - - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - 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, - 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 - - - @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: - """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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_link_resources_operations.py deleted file mode 100644 index 990798e11422..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,103 +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._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', {})) - - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - - - 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) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, 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_10_01_preview/aio/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_quotas_operations.py deleted file mode 100644 index bf793b7dea97..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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', "2022-10-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/v2022_10_01_preview/aio/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registries_operations.py deleted file mode 100644 index 0d7b8e8946cc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registries_operations.py +++ /dev/null @@ -1,593 +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_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, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: - """List registries by subscription. - - List registries by 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 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', "2022-10-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, - 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, - 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("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, - skip: Optional[str] = None, - **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 - :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 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', "2022-10-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, - 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, - 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("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', "2022-10-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 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', "2022-10-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, **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 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', "2022-10-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 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', "2022-10-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, 202]: - map_error(status_code=response.status_code, 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('Registry', pipeline_response) - - if response.status_code == 202: - 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', "2022-10-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, 202]: - 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 response.status_code == 202: - 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 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', "2022-10-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': '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/registries/{registryName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_containers_operations.py deleted file mode 100644 index 29626af6ce4a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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. - :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', "2022-10-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', "2022-10-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 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. - :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', "2022-10-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 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. - :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', "2022-10-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', "2022-10-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 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. - :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', "2022-10-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/v2022_10_01_preview/aio/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_versions_operations.py deleted file mode 100644 index cd048ea6d788..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_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_code_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 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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_containers_operations.py deleted file mode 100644 index 1889749353ea..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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/v2022_10_01_preview/aio/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_versions_operations.py deleted file mode 100644 index 6267a8df8873..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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/v2022_10_01_preview/aio/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_containers_operations.py deleted file mode 100644 index 6231b1e8ca77..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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/v2022_10_01_preview/aio/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_versions_operations.py deleted file mode 100644 index 0f53286a5fd7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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/v2022_10_01_preview/aio/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_containers_operations.py deleted file mode 100644 index 649666a304d2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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/v2022_10_01_preview/aio/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_versions_operations.py deleted file mode 100644 index fe53e30507b3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_versions_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 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_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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_schedules_operations.py deleted file mode 100644 index d73251e23420..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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', "2022-10-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', "2022-10-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, **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', "2022-10-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', "2022-10-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', "2022-10-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, **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/v2022_10_01_preview/aio/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_usages_operations.py deleted file mode 100644 index 86be8ad1ca4e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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/v2022_10_01_preview/aio/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_virtual_machine_sizes_operations.py deleted file mode 100644 index 4bbc9f98e159..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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/v2022_10_01_preview/aio/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_connections_operations.py deleted file mode 100644 index e29a99c87f44..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_connections_operations.py +++ /dev/null @@ -1,333 +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._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', {})) - - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - 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, - 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 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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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 delete( # pylint: disable=inconsistent-return-statements - 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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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 - 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 - """ - api_version = kwargs.pop('api_version', "2022-10-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, - 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, - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_features_operations.py deleted file mode 100644 index 005b34f1cc62..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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/v2022_10_01_preview/aio/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspaces_operations.py deleted file mode 100644 index c56bd5ff84f5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspaces_operations.py +++ /dev/null @@ -1,1281 +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_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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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 _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', {})) - - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - 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, - 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 - 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 - """ - api_version = kwargs.pop('api_version', "2022-10-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, - 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('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_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - async def _delete_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', "2022-10-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, - 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) - - 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( # pylint: disable=inconsistent-return-statements - 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 - """ - api_version = kwargs.pop('api_version', "2022-10-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, - 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}"} # 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', {})) - - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - 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, - 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, - 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 - """ - api_version = kwargs.pop('api_version', "2022-10-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, - 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('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 - - @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 - """ - api_version = kwargs.pop('api_version', "2022-10-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, - 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, - 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("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 _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', {})) - - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - 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, - 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, - 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 - """ - api_version = kwargs.pop('api_version', "2022-10-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, - 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('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. - - :param resource_group_name: The name of the resource 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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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 - - - 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', "2022-10-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) - - 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( # 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. - - :param resource_group_name: The name of the resource 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 - """ - api_version = kwargs.pop('api_version', "2022-10-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, **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 - - @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 - """ - api_version = kwargs.pop('api_version', "2022-10-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, - 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, - 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("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_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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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 - - - 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', "2022-10-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 - 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 - """ - api_version = kwargs.pop('api_version', "2022-10-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 - - @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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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_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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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_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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/__init__.py deleted file mode 100644 index 4da32226fd56..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/__init__.py +++ /dev/null @@ -1,1576 +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 AKSSchema - from ._models_py3 import AKSSchemaProperties - from ._models_py3 import AccessKeyAuthTypeWorkspaceConnectionProperties - 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 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 AmlOperation - from ._models_py3 import AmlOperationDisplay - from ._models_py3 import AmlOperationListResult - from ._models_py3 import AmlToken - from ._models_py3 import AmlUserFeature - 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 AutologgerSettings - from ._models_py3 import AzureBlobDatastore - from ._models_py3 import AzureDataLakeGen1Datastore - from ._models_py3 import AzureDataLakeGen2Datastore - from ._models_py3 import AzureDatastore - from ._models_py3 import AzureFileDatastore - from ._models_py3 import BanditPolicy - from ._models_py3 import BatchDeployment - 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 BatchRetrySettings - from ._models_py3 import BayesianSamplingAlgorithm - from ._models_py3 import BindOptions - from ._models_py3 import BuildContext - 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 CocoExportSummary - 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 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 ComputeResource - from ._models_py3 import ComputeResourceSchema - 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 CosmosDbSettings - from ._models_py3 import Cron - from ._models_py3 import CronTrigger - from ._models_py3 import CsvExportSummary - 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 CustomService - from ._models_py3 import CustomTargetLags - from ._models_py3 import CustomTargetRollingWindowSize - from ._models_py3 import DataContainer - from ._models_py3 import DataContainerProperties - from ._models_py3 import DataContainerResourceArmPaginatedResult - 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 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 DatasetExportSummary - 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 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 EarlyTerminationPolicy - from ._models_py3 import EncryptionKeyVaultProperties - 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 EndpointDeploymentPropertiesBase - from ._models_py3 import EndpointPropertiesBase - 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 ExportSummary - 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 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 ForecastingTrainingSettings - from ._models_py3 import GridSamplingAlgorithm - from ._models_py3 import HDInsight - from ._models_py3 import HDInsightProperties - from ._models_py3 import HDInsightSchema - from ._models_py3 import HdfsDatastore - 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 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 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 Kubernetes - from ._models_py3 import KubernetesOnlineDeployment - from ._models_py3 import KubernetesProperties - from ._models_py3 import KubernetesSchema - from ._models_py3 import LabelCategory - from ._models_py3 import LabelClass - from ._models_py3 import LabelingDataConfiguration - from ._models_py3 import LabelingJob - from ._models_py3 import LabelingJobImageProperties - from ._models_py3 import LabelingJobInstructions - from ._models_py3 import LabelingJobMediaProperties - from ._models_py3 import LabelingJobProperties - from ._models_py3 import LabelingJobResourceArmPaginatedResult - from ._models_py3 import LabelingJobTextProperties - 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 MLAssistConfiguration - from ._models_py3 import MLAssistConfigurationDisabled - from ._models_py3 import MLAssistConfigurationEnabled - 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 ManagedIdentityAuthTypeWorkspaceConnectionProperties - from ._models_py3 import ManagedOnlineDeployment - from ._models_py3 import ManagedServiceIdentity - from ._models_py3 import MedianStoppingPolicy - from ._models_py3 import ModelContainer - from ._models_py3 import ModelContainerProperties - from ._models_py3 import ModelContainerResourceArmPaginatedResult - from ._models_py3 import ModelVersion - from ._models_py3 import ModelVersionProperties - from ._models_py3 import ModelVersionResourceArmPaginatedResult - from ._models_py3 import Mpi - from ._models_py3 import NCrossValidations - from ._models_py3 import NlpFixedParameters - from ._models_py3 import NlpParameterSubspace - from ._models_py3 import NlpSweepSettings - 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 Objective - 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 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 PartialRegistryPartialTrackedResource - from ._models_py3 import PartialSku - from ._models_py3 import Password - from ._models_py3 import PersonalComputeInstanceSettings - from ._models_py3 import PipelineJob - 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 ProbeSettings - from ._models_py3 import ProgressMetrics - from ._models_py3 import PyTorch - from ._models_py3 import QuotaBaseProperties - from ._models_py3 import QuotaUpdateParameters - 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 Registry - from ._models_py3 import RegistryListCredentialsResult - from ._models_py3 import RegistryProperties - from ._models_py3 import RegistryRegionArmDetails - from ._models_py3 import RegistryTrackedResourceArmPaginatedResult - from ._models_py3 import Regression - from ._models_py3 import RegressionTrainingSettings - 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 Route - from ._models_py3 import SASAuthTypeWorkspaceConnectionProperties - 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 ServiceManagedResourcesSettings - from ._models_py3 import ServicePrincipalAuthTypeWorkspaceConnectionProperties - from ._models_py3 import ServicePrincipalDatastoreCredentials - from ._models_py3 import ServicePrincipalDatastoreSecrets - 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 SslConfiguration - from ._models_py3 import StackEnsembleSettings - from ._models_py3 import StatusMessage - 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 TableFixedParameters - from ._models_py3 import TableParameterSubspace - from ._models_py3 import TableSweepSettings - 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 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 Workspace - from ._models_py3 import WorkspaceConnectionAccessKey - from ._models_py3 import WorkspaceConnectionManagedIdentity - 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 WorkspaceConnectionUsernamePassword - from ._models_py3 import WorkspaceListResult - from ._models_py3 import WorkspaceUpdateParameters -except (SyntaxError, ImportError): - 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 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 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 AmlOperation # type: ignore - from ._models import AmlOperationDisplay # type: ignore - from ._models import AmlOperationListResult # type: ignore - from ._models import AmlToken # type: ignore - from ._models import AmlUserFeature # 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 AutologgerSettings # 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 AzureFileDatastore # type: ignore - from ._models import BanditPolicy # type: ignore - from ._models import BatchDeployment # 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 BatchRetrySettings # type: ignore - from ._models import BayesianSamplingAlgorithm # type: ignore - from ._models import BindOptions # 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 ClassificationTrainingSettings # type: ignore - from ._models import ClusterUpdateParameters # type: ignore - from ._models import CocoExportSummary # 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 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 ComputeResource # type: ignore - from ._models import ComputeResourceSchema # 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 CosmosDbSettings # type: ignore - from ._models import Cron # type: ignore - from ._models import CronTrigger # type: ignore - from ._models import CsvExportSummary # 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 CustomService # type: ignore - from ._models import CustomTargetLags # type: ignore - from ._models import CustomTargetRollingWindowSize # type: ignore - from ._models import DataContainer # type: ignore - from ._models import DataContainerProperties # type: ignore - from ._models import DataContainerResourceArmPaginatedResult # 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 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 DatasetExportSummary # 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 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 EarlyTerminationPolicy # type: ignore - from ._models import EncryptionKeyVaultProperties # 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 EndpointDeploymentPropertiesBase # type: ignore - from ._models import EndpointPropertiesBase # 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 ExportSummary # 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 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 ForecastingTrainingSettings # 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 HdfsDatastore # 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 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 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 Kubernetes # type: ignore - from ._models import KubernetesOnlineDeployment # type: ignore - from ._models import KubernetesProperties # type: ignore - from ._models import KubernetesSchema # type: ignore - from ._models import LabelCategory # type: ignore - from ._models import LabelClass # type: ignore - from ._models import LabelingDataConfiguration # type: ignore - from ._models import LabelingJob # type: ignore - from ._models import LabelingJobImageProperties # type: ignore - from ._models import LabelingJobInstructions # type: ignore - from ._models import LabelingJobMediaProperties # type: ignore - from ._models import LabelingJobProperties # type: ignore - from ._models import LabelingJobResourceArmPaginatedResult # type: ignore - from ._models import LabelingJobTextProperties # 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 MLAssistConfiguration # type: ignore - from ._models import MLAssistConfigurationDisabled # type: ignore - from ._models import MLAssistConfigurationEnabled # 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 ManagedIdentityAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import ManagedOnlineDeployment # type: ignore - from ._models import ManagedServiceIdentity # 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 ModelVersion # type: ignore - from ._models import ModelVersionProperties # type: ignore - from ._models import ModelVersionResourceArmPaginatedResult # type: ignore - from ._models import Mpi # type: ignore - from ._models import NCrossValidations # type: ignore - from ._models import NlpFixedParameters # type: ignore - from ._models import NlpParameterSubspace # type: ignore - from ._models import NlpSweepSettings # 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 Objective # 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 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 PartialRegistryPartialTrackedResource # type: ignore - from ._models import PartialSku # type: ignore - from ._models import Password # type: ignore - from ._models import PersonalComputeInstanceSettings # type: ignore - from ._models import PipelineJob # 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 ProbeSettings # type: ignore - from ._models import ProgressMetrics # type: ignore - from ._models import PyTorch # type: ignore - from ._models import QuotaBaseProperties # type: ignore - from ._models import QuotaUpdateParameters # 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 Registry # type: ignore - from ._models import RegistryListCredentialsResult # type: ignore - from ._models import RegistryProperties # 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 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 Route # type: ignore - from ._models import SASAuthTypeWorkspaceConnectionProperties # 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 ServiceManagedResourcesSettings # type: ignore - from ._models import ServicePrincipalAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import ServicePrincipalDatastoreCredentials # type: ignore - from ._models import ServicePrincipalDatastoreSecrets # 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 SslConfiguration # type: ignore - from ._models import StackEnsembleSettings # type: ignore - from ._models import StatusMessage # 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 TableFixedParameters # type: ignore - from ._models import TableParameterSubspace # type: ignore - from ._models import TableSweepSettings # 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 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 Workspace # type: ignore - from ._models import WorkspaceConnectionAccessKey # type: ignore - from ._models import WorkspaceConnectionManagedIdentity # 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 WorkspaceConnectionUsernamePassword # type: ignore - from ._models import WorkspaceListResult # type: ignore - from ._models import WorkspaceUpdateParameters # type: ignore - -from ._azure_machine_learning_workspaces_enums import ( - AllocationState, - ApplicationSharingPolicy, - AssetProvisioningState, - Autosave, - BatchLoggingLevel, - BatchOutputAction, - BillingCurrency, - BlockedTransformers, - Caching, - ClassificationModels, - ClassificationMultilabelPrimaryMetrics, - ClassificationPrimaryMetrics, - ClusterPurpose, - ComputeInstanceAuthorizationType, - ComputeInstanceState, - ComputePowerAction, - ComputeProvisioningState, - ComputeType, - ConnectionAuthType, - ContainerType, - CreatedByType, - CredentialsType, - DataType, - DatastoreType, - DeploymentProvisioningState, - DiagnoseResultLevel, - DistributionType, - EarlyTerminationPolicyType, - EgressPublicNetworkAccessType, - EncryptionStatus, - EndpointAuthMode, - EndpointComputeType, - EndpointProvisioningState, - EnvironmentType, - EnvironmentVariableType, - ExportFormatType, - FeatureLags, - FeaturizationMode, - ForecastHorizonMode, - ForecastingModels, - ForecastingPrimaryMetrics, - Goal, - IdentityConfigurationType, - ImageAnnotationType, - ImageType, - InputDeliveryMode, - InstanceSegmentationPrimaryMetrics, - JobInputType, - JobLimitsType, - JobOutputType, - JobProvisioningState, - JobStatus, - JobType, - KeyType, - LearningRateScheduler, - ListViewType, - LoadBalancerType, - LogVerbosity, - MLAssistConfigurationType, - MLFlowAutologgerState, - ManagedServiceIdentityType, - MediaType, - MlflowAutologger, - ModelSize, - MountAction, - MountState, - NCrossValidationsMode, - Network, - NlpLearningRateScheduler, - NodeState, - NodesValueType, - ObjectDetectionPrimaryMetrics, - OperatingSystemType, - OperationName, - OperationStatus, - OperationTrigger, - OrderString, - OsType, - OutputDeliveryMode, - PrivateEndpointConnectionProvisioningState, - PrivateEndpointServiceConnectionStatus, - Protocol, - ProvisioningStatus, - PublicNetworkAccess, - PublicNetworkAccessType, - QuotaUnit, - RandomSamplingAlgorithmRule, - RecurrenceFrequency, - ReferenceType, - RegressionModels, - RegressionPrimaryMetrics, - RemoteLoginPortPublicAccess, - SamplingAlgorithmType, - ScaleType, - ScheduleActionType, - ScheduleListViewType, - ScheduleProvisioningState, - ScheduleProvisioningStatus, - ScheduleStatus, - SeasonalityMode, - SecretsType, - ServiceDataAccessAuthIdentity, - ShortSeriesHandlingConfiguration, - SkuScaleType, - SkuTier, - SourceType, - SparkJobEntryType, - SshPublicAccess, - SslConfigStatus, - StackMetaLearnerType, - Status, - StatusMessageLevel, - StochasticOptimizer, - StorageAccountType, - TargetAggregationFunction, - TargetLagsMode, - TargetRollingWindowSizeMode, - TaskType, - TextAnnotationType, - TriggerType, - UnderlyingResourceAction, - UnitOfMeasure, - UsageUnit, - UseStl, - VMPriceOSType, - VMTier, - ValidationMetricType, - ValueFormat, - VmPriority, - VolumeDefinitionType, - WeekDay, - WorkspaceProvisioningState, -) - -__all__ = [ - 'AKS', - 'AKSSchema', - 'AKSSchemaProperties', - 'AccessKeyAuthTypeWorkspaceConnectionProperties', - 'AccountKeyDatastoreCredentials', - 'AccountKeyDatastoreSecrets', - 'AcrDetails', - 'AksComputeSecrets', - 'AksComputeSecretsProperties', - 'AksNetworkingConfiguration', - 'AllNodes', - 'AmlCompute', - 'AmlComputeNodeInformation', - 'AmlComputeNodesInformation', - 'AmlComputeProperties', - 'AmlComputeSchema', - 'AmlOperation', - 'AmlOperationDisplay', - 'AmlOperationListResult', - 'AmlToken', - 'AmlUserFeature', - 'ArmResourceId', - 'AssetBase', - 'AssetContainer', - 'AssetJobInput', - 'AssetJobOutput', - 'AssetReferenceBase', - 'AssignedUser', - 'AutoForecastHorizon', - 'AutoMLJob', - 'AutoMLVertical', - 'AutoNCrossValidations', - 'AutoPauseProperties', - 'AutoScaleProperties', - 'AutoSeasonality', - 'AutoTargetLags', - 'AutoTargetRollingWindowSize', - 'AutologgerSettings', - 'AzureBlobDatastore', - 'AzureDataLakeGen1Datastore', - 'AzureDataLakeGen2Datastore', - 'AzureDatastore', - 'AzureFileDatastore', - 'BanditPolicy', - 'BatchDeployment', - 'BatchDeploymentProperties', - 'BatchDeploymentTrackedResourceArmPaginatedResult', - 'BatchEndpoint', - 'BatchEndpointDefaults', - 'BatchEndpointProperties', - 'BatchEndpointTrackedResourceArmPaginatedResult', - 'BatchRetrySettings', - 'BayesianSamplingAlgorithm', - 'BindOptions', - 'BuildContext', - 'CertificateDatastoreCredentials', - 'CertificateDatastoreSecrets', - 'Classification', - 'ClassificationTrainingSettings', - 'ClusterUpdateParameters', - 'CocoExportSummary', - 'CodeConfiguration', - 'CodeContainer', - 'CodeContainerProperties', - 'CodeContainerResourceArmPaginatedResult', - 'CodeVersion', - 'CodeVersionProperties', - 'CodeVersionResourceArmPaginatedResult', - 'ColumnTransformer', - 'CommandJob', - 'CommandJobLimits', - 'ComponentContainer', - 'ComponentContainerProperties', - 'ComponentContainerResourceArmPaginatedResult', - 'ComponentVersion', - 'ComponentVersionProperties', - 'ComponentVersionResourceArmPaginatedResult', - 'Compute', - 'ComputeInstance', - 'ComputeInstanceApplication', - 'ComputeInstanceAutologgerSettings', - 'ComputeInstanceConnectivityEndpoints', - 'ComputeInstanceContainer', - 'ComputeInstanceCreatedBy', - 'ComputeInstanceDataDisk', - 'ComputeInstanceDataMount', - 'ComputeInstanceEnvironmentInfo', - 'ComputeInstanceLastOperation', - 'ComputeInstanceProperties', - 'ComputeInstanceSchema', - 'ComputeInstanceSshSettings', - 'ComputeInstanceVersion', - 'ComputeResource', - 'ComputeResourceSchema', - 'ComputeSchedules', - 'ComputeSecrets', - 'ComputeStartStopSchedule', - 'ContainerResourceRequirements', - 'ContainerResourceSettings', - 'CosmosDbSettings', - 'Cron', - 'CronTrigger', - 'CsvExportSummary', - 'CustomForecastHorizon', - 'CustomModelJobInput', - 'CustomModelJobOutput', - 'CustomNCrossValidations', - 'CustomSeasonality', - 'CustomService', - 'CustomTargetLags', - 'CustomTargetRollingWindowSize', - 'DataContainer', - 'DataContainerProperties', - 'DataContainerResourceArmPaginatedResult', - 'DataFactory', - 'DataLakeAnalytics', - 'DataLakeAnalyticsSchema', - 'DataLakeAnalyticsSchemaProperties', - 'DataPathAssetReference', - 'DataVersionBase', - 'DataVersionBaseProperties', - 'DataVersionBaseResourceArmPaginatedResult', - 'Databricks', - 'DatabricksComputeSecrets', - 'DatabricksComputeSecretsProperties', - 'DatabricksProperties', - 'DatabricksSchema', - 'DatasetExportSummary', - 'Datastore', - 'DatastoreCredentials', - 'DatastoreProperties', - 'DatastoreResourceArmPaginatedResult', - 'DatastoreSecrets', - 'DefaultScaleSettings', - 'DeploymentLogs', - 'DeploymentLogsRequest', - 'DeploymentResourceConfiguration', - 'DiagnoseRequestProperties', - 'DiagnoseResponseResult', - 'DiagnoseResponseResultValue', - 'DiagnoseResult', - 'DiagnoseWorkspaceParameters', - 'DistributionConfiguration', - 'Docker', - 'EarlyTerminationPolicy', - 'EncryptionKeyVaultProperties', - 'EncryptionKeyVaultUpdateProperties', - 'EncryptionProperty', - 'EncryptionUpdateProperties', - 'Endpoint', - 'EndpointAuthKeys', - 'EndpointAuthToken', - 'EndpointDeploymentPropertiesBase', - 'EndpointPropertiesBase', - 'EndpointScheduleAction', - 'EnvironmentContainer', - 'EnvironmentContainerProperties', - 'EnvironmentContainerResourceArmPaginatedResult', - 'EnvironmentVariable', - 'EnvironmentVersion', - 'EnvironmentVersionProperties', - 'EnvironmentVersionResourceArmPaginatedResult', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'EstimatedVMPrice', - 'EstimatedVMPrices', - 'ExportSummary', - 'ExternalFQDNResponse', - 'FQDNEndpoint', - 'FQDNEndpointDetail', - 'FQDNEndpoints', - 'FQDNEndpointsProperties', - 'FeaturizationSettings', - 'FlavorData', - 'ForecastHorizon', - 'Forecasting', - 'ForecastingSettings', - 'ForecastingTrainingSettings', - 'GridSamplingAlgorithm', - 'HDInsight', - 'HDInsightProperties', - 'HDInsightSchema', - 'HdfsDatastore', - 'IdAssetReference', - 'IdentityConfiguration', - 'IdentityForCmk', - 'IdleShutdownSetting', - 'Image', - 'ImageClassification', - 'ImageClassificationBase', - 'ImageClassificationMultilabel', - 'ImageInstanceSegmentation', - 'ImageLimitSettings', - 'ImageMetadata', - 'ImageModelDistributionSettings', - 'ImageModelDistributionSettingsClassification', - 'ImageModelDistributionSettingsObjectDetection', - 'ImageModelSettings', - 'ImageModelSettingsClassification', - 'ImageModelSettingsObjectDetection', - 'ImageObjectDetection', - 'ImageObjectDetectionBase', - 'ImageSweepSettings', - 'ImageVertical', - 'InferenceContainerProperties', - 'InstanceTypeSchema', - 'InstanceTypeSchemaResources', - 'JobBase', - 'JobBaseProperties', - 'JobBaseResourceArmPaginatedResult', - 'JobInput', - 'JobLimits', - 'JobOutput', - 'JobResourceConfiguration', - 'JobScheduleAction', - 'JobService', - 'KerberosCredentials', - 'KerberosKeytabCredentials', - 'KerberosKeytabSecrets', - 'KerberosPasswordCredentials', - 'KerberosPasswordSecrets', - 'Kubernetes', - 'KubernetesOnlineDeployment', - 'KubernetesProperties', - 'KubernetesSchema', - 'LabelCategory', - 'LabelClass', - 'LabelingDataConfiguration', - 'LabelingJob', - 'LabelingJobImageProperties', - 'LabelingJobInstructions', - 'LabelingJobMediaProperties', - 'LabelingJobProperties', - 'LabelingJobResourceArmPaginatedResult', - 'LabelingJobTextProperties', - 'ListAmlUserFeatureResult', - 'ListNotebookKeysResult', - 'ListStorageAccountKeysResult', - 'ListUsagesResult', - 'ListWorkspaceKeysResult', - 'ListWorkspaceQuotas', - 'LiteralJobInput', - 'MLAssistConfiguration', - 'MLAssistConfigurationDisabled', - 'MLAssistConfigurationEnabled', - 'MLFlowModelJobInput', - 'MLFlowModelJobOutput', - 'MLTableData', - 'MLTableJobInput', - 'MLTableJobOutput', - 'ManagedIdentity', - 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', - 'ManagedOnlineDeployment', - 'ManagedServiceIdentity', - 'MedianStoppingPolicy', - 'ModelContainer', - 'ModelContainerProperties', - 'ModelContainerResourceArmPaginatedResult', - 'ModelVersion', - 'ModelVersionProperties', - 'ModelVersionResourceArmPaginatedResult', - 'Mpi', - 'NCrossValidations', - 'NlpFixedParameters', - 'NlpParameterSubspace', - 'NlpSweepSettings', - 'NlpVertical', - 'NlpVerticalFeaturizationSettings', - 'NlpVerticalLimitSettings', - 'NodeStateCounts', - 'Nodes', - 'NoneAuthTypeWorkspaceConnectionProperties', - 'NoneDatastoreCredentials', - 'NotebookAccessTokenResult', - 'NotebookPreparationError', - 'NotebookResourceInfo', - 'Objective', - 'OnlineDeployment', - 'OnlineDeploymentProperties', - 'OnlineDeploymentTrackedResourceArmPaginatedResult', - 'OnlineEndpoint', - 'OnlineEndpointProperties', - 'OnlineEndpointTrackedResourceArmPaginatedResult', - 'OnlineRequestSettings', - 'OnlineScaleSettings', - 'OutputPathAssetReference', - 'PATAuthTypeWorkspaceConnectionProperties', - 'PaginatedComputeResourcesList', - 'PartialBatchDeployment', - 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties', - 'PartialManagedServiceIdentity', - 'PartialMinimalTrackedResource', - 'PartialMinimalTrackedResourceWithIdentity', - 'PartialMinimalTrackedResourceWithSku', - 'PartialRegistryPartialTrackedResource', - 'PartialSku', - 'Password', - 'PersonalComputeInstanceSettings', - 'PipelineJob', - 'PrivateEndpoint', - 'PrivateEndpointConnection', - 'PrivateEndpointConnectionListResult', - 'PrivateLinkResource', - 'PrivateLinkResourceListResult', - 'PrivateLinkServiceConnectionState', - 'ProbeSettings', - 'ProgressMetrics', - 'PyTorch', - 'QuotaBaseProperties', - 'QuotaUpdateParameters', - 'RandomSamplingAlgorithm', - 'Recurrence', - 'RecurrenceSchedule', - 'RecurrenceTrigger', - 'RegenerateEndpointKeysRequest', - 'Registry', - 'RegistryListCredentialsResult', - 'RegistryProperties', - 'RegistryRegionArmDetails', - 'RegistryTrackedResourceArmPaginatedResult', - 'Regression', - 'RegressionTrainingSettings', - 'Resource', - 'ResourceBase', - 'ResourceConfiguration', - 'ResourceId', - 'ResourceName', - 'ResourceQuota', - 'Route', - 'SASAuthTypeWorkspaceConnectionProperties', - 'SamplingAlgorithm', - 'SasDatastoreCredentials', - 'SasDatastoreSecrets', - 'ScaleSettings', - 'ScaleSettingsInformation', - 'Schedule', - 'ScheduleActionBase', - 'ScheduleBase', - 'ScheduleProperties', - 'ScheduleResourceArmPaginatedResult', - 'ScriptReference', - 'ScriptsToExecute', - 'Seasonality', - 'ServiceManagedResourcesSettings', - 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', - 'ServicePrincipalDatastoreCredentials', - 'ServicePrincipalDatastoreSecrets', - 'SetupScripts', - 'SharedPrivateLinkResource', - 'Sku', - 'SkuCapacity', - 'SkuResource', - 'SkuResourceArmPaginatedResult', - 'SkuSetting', - 'SparkJob', - 'SparkJobEntry', - 'SparkJobPythonEntry', - 'SparkJobScalaEntry', - 'SparkResourceConfiguration', - 'SslConfiguration', - 'StackEnsembleSettings', - 'StatusMessage', - 'StorageAccountDetails', - 'SweepJob', - 'SweepJobLimits', - 'SynapseSpark', - 'SynapseSparkProperties', - 'SystemCreatedAcrAccount', - 'SystemCreatedStorageAccount', - 'SystemData', - 'SystemService', - 'TableFixedParameters', - 'TableParameterSubspace', - 'TableSweepSettings', - 'TableVertical', - 'TableVerticalFeaturizationSettings', - 'TableVerticalLimitSettings', - 'TargetLags', - 'TargetRollingWindowSize', - 'TargetUtilizationScaleSettings', - 'TensorFlow', - 'TextClassification', - 'TextClassificationMultilabel', - 'TextNer', - 'TmpfsOptions', - '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', - 'Workspace', - 'WorkspaceConnectionAccessKey', - 'WorkspaceConnectionManagedIdentity', - 'WorkspaceConnectionPersonalAccessToken', - 'WorkspaceConnectionPropertiesV2', - 'WorkspaceConnectionPropertiesV2BasicResource', - 'WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult', - 'WorkspaceConnectionServicePrincipal', - 'WorkspaceConnectionSharedAccessSignature', - 'WorkspaceConnectionUsernamePassword', - 'WorkspaceListResult', - 'WorkspaceUpdateParameters', - 'AllocationState', - 'ApplicationSharingPolicy', - 'AssetProvisioningState', - 'Autosave', - 'BatchLoggingLevel', - 'BatchOutputAction', - 'BillingCurrency', - 'BlockedTransformers', - 'Caching', - 'ClassificationModels', - 'ClassificationMultilabelPrimaryMetrics', - 'ClassificationPrimaryMetrics', - 'ClusterPurpose', - 'ComputeInstanceAuthorizationType', - 'ComputeInstanceState', - 'ComputePowerAction', - 'ComputeProvisioningState', - 'ComputeType', - 'ConnectionAuthType', - 'ContainerType', - 'CreatedByType', - 'CredentialsType', - 'DataType', - 'DatastoreType', - 'DeploymentProvisioningState', - 'DiagnoseResultLevel', - 'DistributionType', - 'EarlyTerminationPolicyType', - 'EgressPublicNetworkAccessType', - 'EncryptionStatus', - 'EndpointAuthMode', - 'EndpointComputeType', - 'EndpointProvisioningState', - 'EnvironmentType', - 'EnvironmentVariableType', - 'ExportFormatType', - 'FeatureLags', - 'FeaturizationMode', - 'ForecastHorizonMode', - 'ForecastingModels', - 'ForecastingPrimaryMetrics', - 'Goal', - 'IdentityConfigurationType', - 'ImageAnnotationType', - 'ImageType', - 'InputDeliveryMode', - 'InstanceSegmentationPrimaryMetrics', - 'JobInputType', - 'JobLimitsType', - 'JobOutputType', - 'JobProvisioningState', - 'JobStatus', - 'JobType', - 'KeyType', - 'LearningRateScheduler', - 'ListViewType', - 'LoadBalancerType', - 'LogVerbosity', - 'MLAssistConfigurationType', - 'MLFlowAutologgerState', - 'ManagedServiceIdentityType', - 'MediaType', - 'MlflowAutologger', - 'ModelSize', - 'MountAction', - 'MountState', - 'NCrossValidationsMode', - 'Network', - 'NlpLearningRateScheduler', - 'NodeState', - 'NodesValueType', - 'ObjectDetectionPrimaryMetrics', - 'OperatingSystemType', - 'OperationName', - 'OperationStatus', - 'OperationTrigger', - 'OrderString', - 'OsType', - 'OutputDeliveryMode', - 'PrivateEndpointConnectionProvisioningState', - 'PrivateEndpointServiceConnectionStatus', - 'Protocol', - 'ProvisioningStatus', - 'PublicNetworkAccess', - 'PublicNetworkAccessType', - 'QuotaUnit', - 'RandomSamplingAlgorithmRule', - 'RecurrenceFrequency', - 'ReferenceType', - 'RegressionModels', - 'RegressionPrimaryMetrics', - 'RemoteLoginPortPublicAccess', - 'SamplingAlgorithmType', - 'ScaleType', - 'ScheduleActionType', - 'ScheduleListViewType', - 'ScheduleProvisioningState', - 'ScheduleProvisioningStatus', - 'ScheduleStatus', - 'SeasonalityMode', - 'SecretsType', - 'ServiceDataAccessAuthIdentity', - 'ShortSeriesHandlingConfiguration', - 'SkuScaleType', - 'SkuTier', - 'SourceType', - 'SparkJobEntryType', - 'SshPublicAccess', - 'SslConfigStatus', - 'StackMetaLearnerType', - 'Status', - 'StatusMessageLevel', - 'StochasticOptimizer', - 'StorageAccountType', - 'TargetAggregationFunction', - 'TargetLagsMode', - 'TargetRollingWindowSizeMode', - 'TaskType', - 'TextAnnotationType', - 'TriggerType', - 'UnderlyingResourceAction', - 'UnitOfMeasure', - 'UsageUnit', - 'UseStl', - 'VMPriceOSType', - 'VMTier', - 'ValidationMetricType', - 'ValueFormat', - 'VmPriority', - 'VolumeDefinitionType', - 'WeekDay', - 'WorkspaceProvisioningState', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_azure_machine_learning_workspaces_enums.py deleted file mode 100644 index 0ac0a0f2cce5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_azure_machine_learning_workspaces_enums.py +++ /dev/null @@ -1,1492 +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 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 AssetProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Provisioning state of registry asset. - """ - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - -class Autosave(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Auto save settings. - """ - - NONE = "None" - LOCAL = "Local" - REMOTE = "Remote" - -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 BillingCurrency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Three lettered code specifying the currency of the VM price. Example: USD - """ - - USD = "USD" - -class BlockedTransformers(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """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(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Caching type of Data Disk. - """ - - NONE = "None" - READ_ONLY = "ReadOnly" - READ_WRITE = "ReadWrite" - -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 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): - """[Required] The compute power action. - """ - - START = "Start" - STOP = "Stop" - -class ComputeProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """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 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" - ACCESS_KEY = "AccessKey" - -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 = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "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 DiagnoseResultLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level of workspace setup error - """ - - WARNING = "Warning" - ERROR = "Error" - INFORMATION = "Information" - -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 EncryptionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether or not the encryption is enabled for the workspace. - """ - - 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 EnvironmentVariableType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the Environment Variable. Possible values are: local - For local variable - """ - - LOCAL = "local" - -class ExportFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The format of exported labels. - """ - - DATASET = "Dataset" - COCO = "Coco" - CSV = "CSV" - -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 ImageAnnotationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Annotation type of image data. - """ - - CLASSIFICATION = "Classification" - BOUNDING_BOX = "BoundingBox" - INSTANCE_SEGMENTATION = "InstanceSegmentation" - -class ImageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the image. Possible values are: docker - For docker images. azureml - For AzureML - images - """ - - DOCKER = "docker" - AZUREML = "azureml" - -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 = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - CUSTOM_MODEL = "custom_model" - MLFLOW_MODEL = "mlflow_model" - TRITON_MODEL = "triton_model" - -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 = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - CUSTOM_MODEL = "custom_model" - MLFLOW_MODEL = "mlflow_model" - TRITON_MODEL = "triton_model" - -class JobProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the job provisioning state. - """ - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - IN_PROGRESS = "InProgress" - -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" - LABELING = "Labeling" - SWEEP = "Sweep" - PIPELINE = "Pipeline" - SPARK = "Spark" - -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 LoadBalancerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Load Balancer Type - """ - - PUBLIC_IP = "PublicIp" - INTERNAL_LOAD_BALANCER = "InternalLoadBalancer" - -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 MediaType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Media type of data asset. - """ - - IMAGE = "Image" - TEXT = "Text" - -class MLAssistConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class MlflowAutologger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether mlflow autologger is enabled for notebooks. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class MLFlowAutologgerState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the state of mlflow autologger. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -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 MountAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount Action. - """ - - MOUNT = "Mount" - UNMOUNT = "Unmount" - -class MountState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount state. - """ - - MOUNT_REQUESTED = "MountRequested" - MOUNTED = "Mounted" - MOUNT_FAILED = "MountFailed" - UNMOUNT_REQUESTED = "UnmountRequested" - UNMOUNT_FAILED = "UnmountFailed" - UNMOUNTED = "Unmounted" - -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 Network(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """network of this container. - """ - - BRIDGE = "Bridge" - HOST = "Host" - -class NlpLearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum of learning rate schedulers that aligns with those supported by HF - """ - - #: No learning rate schedule. - NONE = "None" - #: Linear warmup and decay. - LINEAR = "Linear" - #: Linear warmup then cosine decay. - COSINE = "Cosine" - #: Linear warmup, cosine decay, then restart to initial LR. - COSINE_WITH_RESTARTS = "CosineWithRestarts" - #: Increase linearly then polynomially decay. - POLYNOMIAL = "Polynomial" - #: Constant learning rate. - CONSTANT = "Constant" - #: Linear warmup followed by constant value. - CONSTANT_WITH_WARMUP = "ConstantWithWarmup" - -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 NodesValueType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The enumerated types for the nodes value - """ - - ALL = "All" - 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 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 OperationTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Trigger of operation. - """ - - USER = "User" - SCHEDULE = "Schedule" - IDLE_SHUTDOWN = "IdleShutdown" - -class OrderString(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - CREATED_AT_DESC = "CreatedAtDesc" - CREATED_AT_ASC = "CreatedAtAsc" - UPDATED_AT_DESC = "UpdatedAtDesc" - UPDATED_AT_ASC = "UpdatedAtAsc" - -class OsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Compute OS Type - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class OutputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Output data delivery mode enums. - """ - - READ_WRITE_MOUNT = "ReadWriteMount" - UPLOAD = "Upload" - DIRECT = "Direct" - -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 Protocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Protocol over which communication will happen over this endpoint - """ - - TCP = "tcp" - UDP = "udp" - HTTP = "http" - -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 PublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class QuotaUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of quota measurement. - """ - - COUNT = "Count" - -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 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 SamplingAlgorithmType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - GRID = "Grid" - RANDOM = "Random" - BAYESIAN = "Bayesian" - -class ScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - DEFAULT = "Default" - TARGET_UTILIZATION = "TargetUtilization" - -class ScheduleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - CREATE_JOB = "CreateJob" - INVOKE_BATCH_ENDPOINT = "InvokeBatchEndpoint" - -class ScheduleListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - ENABLED_ONLY = "EnabledOnly" - DISABLED_ONLY = "DisabledOnly" - ALL = "All" - -class ScheduleProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current deployment state of schedule. - """ - - COMPLETED = "Completed" - PROVISIONING = "Provisioning" - FAILED = "Failed" - -class ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - -class ScheduleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Is the schedule enabled or disabled? - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -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 SourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Data source type. - """ - - DATASET = "Dataset" - DATASTORE = "Datastore" - URI = "URI" - -class SparkJobEntryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - SPARK_JOB_PYTHON_ENTRY = "SparkJobPythonEntry" - SPARK_JOB_SCALA_ENTRY = "SparkJobScalaEntry" - -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 SslConfigStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enable or disable ssl for scoring - """ - - DISABLED = "Disabled" - ENABLED = "Enabled" - 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" - #: 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(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 StatusMessageLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - ERROR = "Error" - INFORMATION = "Information" - WARNING = "Warning" - -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 StorageAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """type of this storage account. - """ - - STANDARD_LRS = "Standard_LRS" - PREMIUM_LRS = "Premium_LRS" - -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 TextAnnotationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Annotation type of text data. - """ - - CLASSIFICATION = "Classification" - NAMED_ENTITY_RECOGNITION = "NamedEntityRecognition" - -class TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - 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 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 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" - -class VolumeDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe - """ - - BIND = "bind" - VOLUME = "volume" - TMPFS = "tmpfs" - NPIPE = "npipe" - -class WeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """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 WorkspaceProvisioningState(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" - SOFT_DELETED = "SoftDeleted" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models.py deleted file mode 100644 index 44231122f8a4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models.py +++ /dev/null @@ -1,23543 +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: AccessKeyAuthTypeWorkspaceConnectionProperties, 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. - :vartype category: str - :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 - """ - - _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'}, - } - - _subtype_map = { - 'auth_type': {'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', 'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. - :paramtype category: str - :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 - """ - 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) - - -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """AccessKeyAuthTypeWorkspaceConnectionProperties. - - 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. - :vartype category: str - :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 credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. - :paramtype category: str - :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 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 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 AcrDetails(msrest.serialization.Model): - """Details of ACR account to be used for the Registry. - - :ivar system_created_acr_account: - :vartype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :ivar user_created_acr_account: - :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: - :paramtype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :keyword user_created_acr_account: - :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.ComputeProvisioningState - :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}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'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 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 - """ - super(Compute, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - self.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 = 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.ComputeProvisioningState - :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}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'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 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 - """ - super(AKS, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AKS' # type: str - self.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 = 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 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", "Custom". - :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", "Custom". - :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.ComputeProvisioningState - :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}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'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 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 - """ - super(AmlCompute, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AmlCompute' # type: str - self.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 = 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 AmlOperation(msrest.serialization.Model): - """Azure Machine Learning 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.AmlOperationDisplay - :ivar is_data_action: Indicates whether the operation applies to data-plane. - :vartype is_data_action: bool - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'AmlOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - } - - 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.AmlOperationDisplay - :keyword is_data_action: Indicates whether the operation applies to data-plane. - :paramtype is_data_action: bool - """ - super(AmlOperation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.is_data_action = kwargs.get('is_data_action', None) - - -class AmlOperationDisplay(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(AmlOperationDisplay, 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 AmlOperationListResult(msrest.serialization.Model): - """An array of operations supported by the resource provider. - - :ivar value: List of AML operations supported by the AML resource provider. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlOperation]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: List of AML operations supported by the AML resource provider. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] - """ - super(AmlOperationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', 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 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 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, '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 AutologgerSettings(msrest.serialization.Model): - """Settings for Autologger. - - All required parameters must be populated in order to send to Azure. - - :ivar mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is enabled. - Possible values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - - _validation = { - 'mlflow_autologger': {'required': True}, - } - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is - enabled. Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - super(AutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = kwargs['mlflow_autologger'] - - -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, LabelingJobProperties, 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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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}'}, - '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'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Labeling': 'LabelingJobProperties', '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 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.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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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.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'}, - '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': '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 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.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.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, 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(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", "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 = { - '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", "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 = { - '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", "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 = { - '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 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", "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 = { - '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 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 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 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.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'}, - '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 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.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.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 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 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 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', 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 ExportSummary(msrest.serialization.Model): - """ExportSummary. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CsvExportSummary, CocoExportSummary, DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - } - - _subtype_map = { - 'format': {'CSV': 'CsvExportSummary', 'Coco': 'CocoExportSummary', 'Dataset': 'DatasetExportSummary'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ExportSummary, self).__init__(**kwargs) - self.end_date_time = None - self.exported_row_count = None - self.format = None # type: Optional[str] - self.labeling_job_id = None - self.start_date_time = None - - -class CocoExportSummary(ExportSummary): - """CocoExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CocoExportSummary, self).__init__(**kwargs) - self.format = 'Coco' # type: str - self.container_name = None - self.snapshot_path = 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(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.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(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.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 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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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 autologger_settings: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :vartype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :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.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, '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'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'AutologgerSettings'}, - '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': '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 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 autologger_settings: Distribution configuration of the job. If set, this should be one - of Mpi, Tensorflow, PyTorch, or null. - :paramtype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :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.JobResourceConfiguration - """ - super(CommandJob, self).__init__(**kwargs) - self.job_type = 'Command' # type: str - self.autologger_settings = kwargs.get('autologger_settings', None) - 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 ComponentContainer(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.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(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.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.ComputeProvisioningState - :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}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'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 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 - """ - super(ComputeInstance, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'ComputeInstance' # type: str - self.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 = 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 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'}, - '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 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.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", "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 - :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", "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 - :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", "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 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}, - 'schedules': {'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'}, - '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 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 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.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 = 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 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 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: Possible values include: "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :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 - :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: Possible values include: "Recurrence", "Cron". - :paramtype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :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 - :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 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 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, '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 CsvExportSummary(ExportSummary): - """CsvExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CsvExportSummary, self).__init__(**kwargs) - self.format = 'CSV' # type: str - self.container_name = None - self.snapshot_path = None - - -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", "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, '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 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] - """ - - _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]'}, - } - - 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] - """ - 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) - - -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.ComputeProvisioningState - :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}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'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 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 - """ - super(Databricks, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Databricks' # type: str - self.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 = 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 DataContainer(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.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 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.ComputeProvisioningState - :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}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'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 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 - """ - 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.ComputeProvisioningState - :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}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'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 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 - """ - super(DataLakeAnalytics, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'DataLakeAnalytics' # type: str - self.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 = 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 DatasetExportSummary(ExportSummary): - """DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar labeled_asset_name: The unique name of the labeled data asset. - :vartype labeled_asset_name: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'labeled_asset_name': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'labeled_asset_name': {'key': 'labeledAssetName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatasetExportSummary, self).__init__(**kwargs) - self.format = 'Dataset' # type: str - self.labeled_asset_name = None - - -class Datastore(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.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(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.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. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001Preview.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', '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. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001Preview.Assets.DataVersionBase.DataType. - :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 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 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 EncryptionKeyVaultProperties(msrest.serialization.Model): - """EncryptionKeyVaultProperties. - - 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(EncryptionKeyVaultProperties, 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 EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): - """EncryptionKeyVaultUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_identifier: Required. Key Vault uri to access the encryption key. - :vartype key_identifier: str - """ - - _validation = { - 'key_identifier': {'required': True}, - } - - _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_identifier: Required. Key Vault uri to access the encryption key. - :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 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.EncryptionKeyVaultProperties - """ - - _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': 'EncryptionKeyVaultProperties'}, - } - - 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.EncryptionKeyVaultProperties - """ - super(EncryptionProperty, self).__init__(**kwargs) - self.status = kwargs['status'] - self.identity = kwargs.get('identity', None) - self.key_vault_properties = kwargs['key_vault_properties'] - - -class EncryptionUpdateProperties(msrest.serialization.Model): - """EncryptionUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_vault_properties: Required. Customer Key vault properties. - :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. Customer Key vault properties. - :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 ScheduleActionBase(msrest.serialization.Model): - """ScheduleActionBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobScheduleAction, 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". - :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', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ScheduleActionBase, self).__init__(**kwargs) - self.action_type = None # type: Optional[str] - - -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". - :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(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.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(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.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 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 - """ - - _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'}, - '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'}, - } - - 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(EnvironmentVersionProperties, 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) - self.provisioning_state = 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.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 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 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', 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 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 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(DatastoreProperties): - """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 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.ComputeProvisioningState - :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}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'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 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 - """ - super(HDInsight, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'HDInsight' # type: str - self.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 = 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, '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 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 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 images. Possible values include: "docker", "azureml". Default value: "docker". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :ivar reference: Image reference URL. - :vartype reference: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', '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 images. Possible values include: "docker", "azureml". Default value: "docker". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :keyword reference: Image reference URL. - :paramtype reference: 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) - - -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. - - :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 - """ - - _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'}, - } - - 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) - - -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 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(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.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". - :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 set by user. - :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 set by user. - :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 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'] - - -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'] - - -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 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.ComputeProvisioningState - :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}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'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 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 - """ - super(Kubernetes, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Kubernetes' # type: str - self.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 = 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 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 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'}, - '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 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.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 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 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'}, - '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 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 LabelCategory(msrest.serialization.Model): - """Label category definition. - - :ivar classes: Dictionary of label classes in this category. - :vartype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :ivar display_name: Display name of the label category. - :vartype display_name: str - :ivar multi_select_enabled: Indicates whether it is allowed to select multiple classes in this - category. - :vartype multi_select_enabled: bool - """ - - _attribute_map = { - 'classes': {'key': 'classes', 'type': '{LabelClass}'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'multi_select_enabled': {'key': 'multiSelectEnabled', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword classes: Dictionary of label classes in this category. - :paramtype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :keyword display_name: Display name of the label category. - :paramtype display_name: str - :keyword multi_select_enabled: Indicates whether it is allowed to select multiple classes in - this category. - :paramtype multi_select_enabled: bool - """ - super(LabelCategory, self).__init__(**kwargs) - self.classes = kwargs.get('classes', None) - self.display_name = kwargs.get('display_name', None) - self.multi_select_enabled = kwargs.get('multi_select_enabled', False) - - -class LabelClass(msrest.serialization.Model): - """Label class definition. - - :ivar display_name: Display name of the label class. - :vartype display_name: str - :ivar subclasses: Dictionary of subclasses of the label class. - :vartype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword display_name: Display name of the label class. - :paramtype display_name: str - :keyword subclasses: Dictionary of subclasses of the label class. - :paramtype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - super(LabelClass, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.subclasses = kwargs.get('subclasses', None) - - -class LabelingDataConfiguration(msrest.serialization.Model): - """Labeling data configuration definition. - - :ivar data_id: Resource Id of the data asset to perform labeling. - :vartype data_id: str - :ivar incremental_data_refresh_enabled: Indicates whether to enable incremental data refresh. - :vartype incremental_data_refresh_enabled: bool - """ - - _attribute_map = { - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'incremental_data_refresh_enabled': {'key': 'incrementalDataRefreshEnabled', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_id: Resource Id of the data asset to perform labeling. - :paramtype data_id: str - :keyword incremental_data_refresh_enabled: Indicates whether to enable incremental data - refresh. - :paramtype incremental_data_refresh_enabled: bool - """ - super(LabelingDataConfiguration, self).__init__(**kwargs) - self.data_id = kwargs.get('data_id', None) - self.incremental_data_refresh_enabled = kwargs.get('incremental_data_refresh_enabled', False) - - -class LabelingJob(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.LabelingJobProperties - """ - - _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': 'LabelingJobProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - super(LabelingJob, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class LabelingJobMediaProperties(msrest.serialization.Model): - """Properties of a labeling job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LabelingJobImageProperties, LabelingJobTextProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - } - - _subtype_map = { - 'media_type': {'Image': 'LabelingJobImageProperties', 'Text': 'LabelingJobTextProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(LabelingJobMediaProperties, self).__init__(**kwargs) - self.media_type = None # type: Optional[str] - - -class LabelingJobImageProperties(LabelingJobMediaProperties): - """Properties of a labeling job for image data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - super(LabelingJobImageProperties, self).__init__(**kwargs) - self.media_type = 'Image' # type: str - self.annotation_type = kwargs.get('annotation_type', None) - - -class LabelingJobInstructions(msrest.serialization.Model): - """Instructions for labeling job. - - :ivar uri: The link to a page with detailed labeling instructions for labelers. - :vartype uri: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword uri: The link to a page with detailed labeling instructions for labelers. - :paramtype uri: str - """ - super(LabelingJobInstructions, self).__init__(**kwargs) - self.uri = kwargs.get('uri', None) - - -class LabelingJobProperties(JobBaseProperties): - """Labeling 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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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 created_date_time: Created time of the job in UTC timezone. - :vartype created_date_time: ~datetime.datetime - :ivar data_configuration: Configuration of data used in the job. - :vartype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :ivar job_instructions: Labeling instructions of the job. - :vartype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :ivar label_categories: Label categories of the job. - :vartype label_categories: dict[str, ~azure.mgmt.machinelearningservices.models.LabelCategory] - :ivar labeling_job_media_properties: Media type specific properties in the job. - :vartype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :ivar ml_assist_configuration: Configuration of MLAssist feature in the job. - :vartype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - :ivar progress_metrics: Progress metrics of the job. - :vartype progress_metrics: ~azure.mgmt.machinelearningservices.models.ProgressMetrics - :ivar project_id: Internal id of the job(Previously called project). - :vartype project_id: str - :ivar provisioning_state: Specifies the labeling job provisioning state. Possible values - include: "Succeeded", "Failed", "Canceled", "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.JobProvisioningState - :ivar status_messages: Status messages of the job. - :vartype status_messages: list[~azure.mgmt.machinelearningservices.models.StatusMessage] - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'progress_metrics': {'readonly': True}, - 'project_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status_messages': {'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'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'data_configuration': {'key': 'dataConfiguration', 'type': 'LabelingDataConfiguration'}, - 'job_instructions': {'key': 'jobInstructions', 'type': 'LabelingJobInstructions'}, - 'label_categories': {'key': 'labelCategories', 'type': '{LabelCategory}'}, - 'labeling_job_media_properties': {'key': 'labelingJobMediaProperties', 'type': 'LabelingJobMediaProperties'}, - 'ml_assist_configuration': {'key': 'mlAssistConfiguration', 'type': 'MLAssistConfiguration'}, - 'progress_metrics': {'key': 'progressMetrics', 'type': 'ProgressMetrics'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status_messages': {'key': 'statusMessages', 'type': '[StatusMessage]'}, - } - - 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 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_configuration: Configuration of data used in the job. - :paramtype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :keyword job_instructions: Labeling instructions of the job. - :paramtype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :keyword label_categories: Label categories of the job. - :paramtype label_categories: dict[str, - ~azure.mgmt.machinelearningservices.models.LabelCategory] - :keyword labeling_job_media_properties: Media type specific properties in the job. - :paramtype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :keyword ml_assist_configuration: Configuration of MLAssist feature in the job. - :paramtype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - """ - super(LabelingJobProperties, self).__init__(**kwargs) - self.job_type = 'Labeling' # type: str - self.created_date_time = None - self.data_configuration = kwargs.get('data_configuration', None) - self.job_instructions = kwargs.get('job_instructions', None) - self.label_categories = kwargs.get('label_categories', None) - self.labeling_job_media_properties = kwargs.get('labeling_job_media_properties', None) - self.ml_assist_configuration = kwargs.get('ml_assist_configuration', None) - self.progress_metrics = None - self.project_id = None - self.provisioning_state = None - self.status_messages = None - - -class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of LabelingJob entities. - - :ivar next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type LabelingJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[LabelingJob]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type LabelingJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - super(LabelingJobResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class LabelingJobTextProperties(LabelingJobMediaProperties): - """Properties of a labeling job for text data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - super(LabelingJobTextProperties, self).__init__(**kwargs) - self.media_type = 'Text' # type: str - self.annotation_type = kwargs.get('annotation_type', 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 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, '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 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. - :vartype category: str - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. - :paramtype category: str - :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 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 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 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 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'}, - '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 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 MLAssistConfiguration(msrest.serialization.Model): - """Labeling MLAssist configuration definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLAssistConfigurationDisabled, MLAssistConfigurationEnabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - _subtype_map = { - 'ml_assist': {'Disabled': 'MLAssistConfigurationDisabled', 'Enabled': 'MLAssistConfigurationEnabled'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfiguration, self).__init__(**kwargs) - self.ml_assist = None # type: Optional[str] - - -class MLAssistConfigurationDisabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is disabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfigurationDisabled, self).__init__(**kwargs) - self.ml_assist = 'Disabled' # type: str - - -class MLAssistConfigurationEnabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is enabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - :ivar inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :vartype inferencing_compute_binding: str - :ivar training_compute_binding: Required. [Required] AML compute binding used in training. - :vartype training_compute_binding: str - """ - - _validation = { - 'ml_assist': {'required': True}, - 'inferencing_compute_binding': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_compute_binding': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - 'inferencing_compute_binding': {'key': 'inferencingComputeBinding', 'type': 'str'}, - 'training_compute_binding': {'key': 'trainingComputeBinding', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :paramtype inferencing_compute_binding: str - :keyword training_compute_binding: Required. [Required] AML compute binding used in training. - :paramtype training_compute_binding: str - """ - super(MLAssistConfigurationEnabled, self).__init__(**kwargs) - self.ml_assist = 'Enabled' # type: str - self.inferencing_compute_binding = kwargs['inferencing_compute_binding'] - self.training_compute_binding = kwargs['training_compute_binding'] - - -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, '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. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001Preview.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.V20221001Preview.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", "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, '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(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.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 ModelVersion(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.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 - """ - - _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'}, - } - - 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 - """ - 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 - - -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 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 NlpFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML NLP training. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: int - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: int - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: int - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: int - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: float - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: float - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'float'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: int - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: int - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: int - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: int - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: float - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: float - """ - super(NlpFixedParameters, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get('gradient_accumulation_steps', 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.number_of_epochs = kwargs.get('number_of_epochs', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_ratio = kwargs.get('warmup_ratio', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class NlpParameterSubspace(msrest.serialization.Model): - """Stringified search spaces for each parameter. See below examples. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :vartype learning_rate_scheduler: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: str - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: str - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: str - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: str - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: str - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :paramtype learning_rate_scheduler: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: str - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: str - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: str - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: str - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: str - """ - super(NlpParameterSubspace, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get('gradient_accumulation_steps', 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.number_of_epochs = kwargs.get('number_of_epochs', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_ratio = kwargs.get('warmup_ratio', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class NlpSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter tuning related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. 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 for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(NlpSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - - -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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_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_nodes: Maximum nodes to leverage for training in any single trial. Controls - multi-node distributed training. - :vartype max_nodes: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Timeout for individual HD trials. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_nodes: Maximum nodes to leverage for training in any single trial. Controls - multi-node distributed training. - :paramtype max_nodes: int - :keyword max_trials: Number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Timeout for individual HD trials. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_nodes = kwargs.get('max_nodes', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") - self.trial_timeout = kwargs.get('trial_timeout', 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. - :vartype category: str - :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 - """ - - _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'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. - :paramtype category: str - :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 - """ - 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", "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 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 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 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: 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 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 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.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: any - :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': 'object'}, - '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: any - :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.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 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. - - 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. - :vartype category: str - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. - :paramtype category: str - :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 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 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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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 - :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'}, - '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 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 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 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 - :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'}, - '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'}, - '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.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 - :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.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 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 - :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'}, - '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'}, - '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.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 - :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.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 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 ProgressMetrics(msrest.serialization.Model): - """Progress metrics definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar completed_datapoint_count: The completed datapoint count. - :vartype completed_datapoint_count: long - :ivar incremental_data_last_refresh_date_time: The time of last successful incremental data - refresh in UTC. - :vartype incremental_data_last_refresh_date_time: ~datetime.datetime - :ivar skipped_datapoint_count: The skipped datapoint count. - :vartype skipped_datapoint_count: long - :ivar total_datapoint_count: The total datapoint count. - :vartype total_datapoint_count: long - """ - - _validation = { - 'completed_datapoint_count': {'readonly': True}, - 'incremental_data_last_refresh_date_time': {'readonly': True}, - 'skipped_datapoint_count': {'readonly': True}, - 'total_datapoint_count': {'readonly': True}, - } - - _attribute_map = { - 'completed_datapoint_count': {'key': 'completedDatapointCount', 'type': 'long'}, - 'incremental_data_last_refresh_date_time': {'key': 'incrementalDataLastRefreshDateTime', 'type': 'iso-8601'}, - 'skipped_datapoint_count': {'key': 'skippedDatapointCount', 'type': 'long'}, - 'total_datapoint_count': {'key': 'totalDatapointCount', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProgressMetrics, self).__init__(**kwargs) - self.completed_datapoint_count = None - self.incremental_data_last_refresh_date_time = None - self.skipped_datapoint_count = None - self.total_datapoint_count = 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 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 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.RecurrenceFrequency - :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.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: [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] 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.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', "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 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 properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RegistryProperties - :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': 'RegistryProperties'}, - '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.RegistryProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(Registry, 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 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 RegistryProperties(ResourceBase): - """Details of the Registry. - - :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 public_network_access: - :vartype public_network_access: str - :ivar discovery_url: - :vartype discovery_url: str - :ivar intellectual_property_publisher: - :vartype intellectual_property_publisher: str - :ivar managed_resource_group: Managed resource group created for the registry. - :vartype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar ml_flow_registry_uri: - :vartype ml_flow_registry_uri: str - :ivar private_link_count: - :vartype private_link_count: int - :ivar region_details: Details of each region the registry is in. - :vartype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - :ivar managed_resource_group_tags: Tags to be applied to the managed resource group associated - with this registry. - :vartype managed_resource_group_tags: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'discovery_url': {'key': 'discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'managedResourceGroup', 'type': 'ArmResourceId'}, - 'ml_flow_registry_uri': {'key': 'mlFlowRegistryUri', 'type': 'str'}, - 'private_link_count': {'key': 'privateLinkCount', 'type': 'int'}, - 'region_details': {'key': 'regionDetails', 'type': '[RegistryRegionArmDetails]'}, - 'managed_resource_group_tags': {'key': 'managedResourceGroupTags', '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 public_network_access: - :paramtype public_network_access: str - :keyword discovery_url: - :paramtype discovery_url: str - :keyword intellectual_property_publisher: - :paramtype intellectual_property_publisher: str - :keyword managed_resource_group: Managed resource group created for the registry. - :paramtype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword ml_flow_registry_uri: - :paramtype ml_flow_registry_uri: str - :keyword private_link_count: - :paramtype private_link_count: int - :keyword region_details: Details of each region the registry is in. - :paramtype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - :keyword managed_resource_group_tags: Tags to be applied to the managed resource group - associated with this registry. - :paramtype managed_resource_group_tags: dict[str, str] - """ - super(RegistryProperties, self).__init__(**kwargs) - self.public_network_access = kwargs.get('public_network_access', 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.ml_flow_registry_uri = kwargs.get('ml_flow_registry_uri', None) - self.private_link_count = kwargs.get('private_link_count', None) - self.region_details = kwargs.get('region_details', None) - self.managed_resource_group_tags = kwargs.get('managed_resource_group_tags', 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', 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 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 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 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. - :vartype category: str - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. - :paramtype category: str - :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 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 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 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(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.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: 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: 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 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. - :vartype category: str - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. - :paramtype category: str - :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 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", "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 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 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): - """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 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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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 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 resource 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 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 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, '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'}, - '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'}, - '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]'}, - '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 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 resource 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 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 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.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.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 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 StatusMessage(msrest.serialization.Model): - """Active message associated with project. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Service-defined message code. - :vartype code: str - :ivar created_date_time: Time in UTC at which the message was created. - :vartype created_date_time: ~datetime.datetime - :ivar level: Severity level of message. Possible values include: "Error", "Information", - "Warning". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.StatusMessageLevel - :ivar message: A human-readable representation of the message code. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(StatusMessage, self).__init__(**kwargs) - self.code = None - self.created_date_time = None - self.level = None - self.message = None - - -class StorageAccountDetails(msrest.serialization.Model): - """Details of storage account to be used for the Registry. - - :ivar system_created_storage_account: - :vartype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :ivar user_created_storage_account: - :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: - :paramtype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :keyword user_created_storage_account: - :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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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}'}, - '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'}, - '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 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 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 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.ComputeProvisioningState - :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}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'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 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 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_sku: - :vartype acr_account_sku: str - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword acr_account_sku: - :paramtype acr_account_sku: str - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(SystemCreatedAcrAccount, self).__init__(**kwargs) - 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 arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar storage_account_hns_enabled: - :vartype storage_account_hns_enabled: bool - :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 = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword storage_account_hns_enabled: - :paramtype storage_account_hns_enabled: bool - :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.arm_resource_id = kwargs.get('arm_resource_id', None) - self.storage_account_hns_enabled = kwargs.get('storage_account_hns_enabled', 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 TableFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML Table training. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: int - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: int - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: int - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: int - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: float - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: int - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: int - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: float - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: float - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: float - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: float - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: bool - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: bool - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'max_bin': {'key': 'maxBin', 'type': 'int'}, - 'max_depth': {'key': 'maxDepth', 'type': 'int'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'int'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'int'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'float'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'int'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'int'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'float'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'float'}, - 'subsample': {'key': 'subsample', 'type': 'float'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'float'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'bool'}, - 'with_std': {'key': 'withStd', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: int - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: int - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: int - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: int - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: float - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: int - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: int - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: float - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: float - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: float - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: float - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: bool - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: bool - """ - super(TableFixedParameters, self).__init__(**kwargs) - self.booster = kwargs.get('booster', None) - self.boosting_type = kwargs.get('boosting_type', None) - self.grow_policy = kwargs.get('grow_policy', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.max_bin = kwargs.get('max_bin', None) - self.max_depth = kwargs.get('max_depth', None) - self.max_leaves = kwargs.get('max_leaves', None) - self.min_data_in_leaf = kwargs.get('min_data_in_leaf', None) - self.min_split_gain = kwargs.get('min_split_gain', None) - self.model_name = kwargs.get('model_name', None) - self.n_estimators = kwargs.get('n_estimators', None) - self.num_leaves = kwargs.get('num_leaves', None) - self.preprocessor_name = kwargs.get('preprocessor_name', None) - self.reg_alpha = kwargs.get('reg_alpha', None) - self.reg_lambda = kwargs.get('reg_lambda', None) - self.subsample = kwargs.get('subsample', None) - self.subsample_freq = kwargs.get('subsample_freq', None) - self.tree_method = kwargs.get('tree_method', None) - self.with_mean = kwargs.get('with_mean', False) - self.with_std = kwargs.get('with_std', False) - - -class TableParameterSubspace(msrest.serialization.Model): - """TableParameterSubspace. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: str - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: str - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: str - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: str - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: str - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: str - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: str - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: str - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: str - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: str - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: str - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: str - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'max_bin': {'key': 'maxBin', 'type': 'str'}, - 'max_depth': {'key': 'maxDepth', 'type': 'str'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'str'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'str'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'str'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'str'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'str'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'str'}, - 'subsample': {'key': 'subsample', 'type': 'str'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'str'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'str'}, - 'with_std': {'key': 'withStd', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: str - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: str - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: str - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: str - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: str - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: str - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: str - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: str - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: str - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: str - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: str - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: str - """ - super(TableParameterSubspace, self).__init__(**kwargs) - self.booster = kwargs.get('booster', None) - self.boosting_type = kwargs.get('boosting_type', None) - self.grow_policy = kwargs.get('grow_policy', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.max_bin = kwargs.get('max_bin', None) - self.max_depth = kwargs.get('max_depth', None) - self.max_leaves = kwargs.get('max_leaves', None) - self.min_data_in_leaf = kwargs.get('min_data_in_leaf', None) - self.min_split_gain = kwargs.get('min_split_gain', None) - self.model_name = kwargs.get('model_name', None) - self.n_estimators = kwargs.get('n_estimators', None) - self.num_leaves = kwargs.get('num_leaves', None) - self.preprocessor_name = kwargs.get('preprocessor_name', None) - self.reg_alpha = kwargs.get('reg_alpha', None) - self.reg_lambda = kwargs.get('reg_lambda', None) - self.subsample = kwargs.get('subsample', None) - self.subsample_freq = kwargs.get('subsample_freq', None) - self.tree_method = kwargs.get('tree_method', None) - self.with_mean = kwargs.get('with_mean', None) - self.with_std = kwargs.get('with_std', None) - - -class TableSweepSettings(msrest.serialization.Model): - """TableSweepSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. 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 for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(TableSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - - -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 sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to trigger. - :vartype sweep_concurrent_trials: int - :ivar sweep_trials: Number of sweeping runs that user wants to trigger. - :vartype sweep_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'}, - 'sweep_concurrent_trials': {'key': 'sweepConcurrentTrials', 'type': 'int'}, - 'sweep_trials': {'key': 'sweepTrials', '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 sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to - trigger. - :paramtype sweep_concurrent_trials: int - :keyword sweep_trials: Number of sweeping runs that user wants to trigger. - :paramtype sweep_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.sweep_concurrent_trials = kwargs.get('sweep_concurrent_trials', 0) - self.sweep_trials = kwargs.get('sweep_trials', 0) - 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_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 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, '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, '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. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001Preview.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.V20221001Preview.Assets.DataVersionBase.DataType. - :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, '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. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001Preview.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.V20221001Preview.Assets.DataVersionBase.DataType. - :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, '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. - - 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. - :vartype category: str - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. - :paramtype category: str - :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 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.ComputeProvisioningState - :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}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'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 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 - """ - super(VirtualMachine, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'VirtualMachine' # type: str - self.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 = 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: 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 - :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. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. - :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", - "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.WorkspaceProvisioningState - :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 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 - :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 soft_deleted_at: The timestamp when the workspace was soft deleted. - :vartype soft_deleted_at: str - :ivar scheduled_purge_date: The timestamp when the soft deleted workspace is going to be - purged. - :vartype scheduled_purge_date: 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}, - 'soft_deleted_at': {'readonly': True}, - 'scheduled_purge_date': {'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'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - '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'}, - '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'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'soft_deleted_at': {'key': 'properties.softDeletedAt', 'type': 'str'}, - 'scheduled_purge_date': {'key': 'properties.scheduledPurgeDate', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :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 - :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. - :paramtype application_insights: str - :keyword container_registry: ARM id of the container registry associated with this workspace. - :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 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 - :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(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.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.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 - self.v1_legacy_mode = kwargs.get('v1_legacy_mode', False) - self.soft_deleted_at = None - self.scheduled_purge_date = 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 WorkspaceConnectionManagedIdentity(msrest.serialization.Model): - """WorkspaceConnectionManagedIdentity. - - :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(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', 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. - - 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 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 WorkspaceConnectionUsernamePassword(msrest.serialization.Model): - """WorkspaceConnectionUsernamePassword. - - :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(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', 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.ManagedServiceIdentity - :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 - :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 encryption: The encryption settings of the workspace. - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - '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'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionUpdateProperties'}, - } - - 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.ManagedServiceIdentity - :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 - :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 encryption: The encryption settings of the workspace. - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - """ - 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) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.encryption = kwargs.get('encryption', None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models_py3.py deleted file mode 100644 index 0906058e44d8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models_py3.py +++ /dev/null @@ -1,25565 +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: AccessKeyAuthTypeWorkspaceConnectionProperties, 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. - :vartype category: str - :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 - """ - - _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'}, - } - - _subtype_map = { - 'auth_type': {'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', 'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} - } - - def __init__( - self, - *, - category: Optional[str] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. - :paramtype category: str - :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 - """ - 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 - - -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """AccessKeyAuthTypeWorkspaceConnectionProperties. - - 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. - :vartype category: str - :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 credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, - } - - def __init__( - self, - *, - category: Optional[str] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionAccessKey"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. - :paramtype category: str - :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 credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'AccessKey' # 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, 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 AcrDetails(msrest.serialization.Model): - """Details of ACR account to be used for the Registry. - - :ivar system_created_acr_account: - :vartype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :ivar user_created_acr_account: - :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: - :paramtype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :keyword user_created_acr_account: - :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.ComputeProvisioningState - :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}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'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, - *, - description: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :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 - """ - super(Compute, self).__init__(**kwargs) - self.compute_type = None # type: Optional[str] - self.compute_location = None - 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 = 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.ComputeProvisioningState - :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}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'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, - description: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword properties: AKS properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties - :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 - """ - super(AKS, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'AKS' # type: str - self.compute_location = None - 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 = 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, - *, - 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 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", "Custom". - :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", "Custom". - :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.ComputeProvisioningState - :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}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'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, - description: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword properties: Properties of AmlCompute. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties - :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 - """ - super(AmlCompute, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'AmlCompute' # type: str - self.compute_location = None - 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 = 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, - *, - 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 AmlOperation(msrest.serialization.Model): - """Azure Machine Learning 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.AmlOperationDisplay - :ivar is_data_action: Indicates whether the operation applies to data-plane. - :vartype is_data_action: bool - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'AmlOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - display: Optional["AmlOperationDisplay"] = None, - is_data_action: Optional[bool] = None, - **kwargs - ): - """ - :keyword name: Operation name: {provider}/{resource}/{operation}. - :paramtype name: str - :keyword display: Display name of operation. - :paramtype display: ~azure.mgmt.machinelearningservices.models.AmlOperationDisplay - :keyword is_data_action: Indicates whether the operation applies to data-plane. - :paramtype is_data_action: bool - """ - super(AmlOperation, self).__init__(**kwargs) - self.name = name - self.display = display - self.is_data_action = is_data_action - - -class AmlOperationDisplay(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(AmlOperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description - - -class AmlOperationListResult(msrest.serialization.Model): - """An array of operations supported by the resource provider. - - :ivar value: List of AML operations supported by the AML resource provider. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlOperation]'}, - } - - def __init__( - self, - *, - value: Optional[List["AmlOperation"]] = None, - **kwargs - ): - """ - :keyword value: List of AML operations supported by the AML resource provider. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] - """ - super(AmlOperationListResult, self).__init__(**kwargs) - self.value = value - - -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 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 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, '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 AutologgerSettings(msrest.serialization.Model): - """Settings for Autologger. - - All required parameters must be populated in order to send to Azure. - - :ivar mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is enabled. - Possible values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - - _validation = { - 'mlflow_autologger': {'required': True}, - } - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - *, - mlflow_autologger: Union[str, "MLFlowAutologgerState"], - **kwargs - ): - """ - :keyword mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is - enabled. Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - super(AutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = mlflow_autologger - - -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, LabelingJobProperties, 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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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}'}, - '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'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Labeling': 'LabelingJobProperties', '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, - 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 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.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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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.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'}, - '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': '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, - 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["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 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.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, 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 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, 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(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", "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 = { - '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", "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 = { - '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", "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 = { - '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 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", "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 = { - '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 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 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 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.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'}, - '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, - 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 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.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.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 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 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 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, 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.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - 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 ExportSummary(msrest.serialization.Model): - """ExportSummary. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CsvExportSummary, CocoExportSummary, DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - } - - _subtype_map = { - 'format': {'CSV': 'CsvExportSummary', 'Coco': 'CocoExportSummary', 'Dataset': 'DatasetExportSummary'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ExportSummary, self).__init__(**kwargs) - self.end_date_time = None - self.exported_row_count = None - self.format = None # type: Optional[str] - self.labeling_job_id = None - self.start_date_time = None - - -class CocoExportSummary(ExportSummary): - """CocoExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CocoExportSummary, self).__init__(**kwargs) - self.format = 'Coco' # type: str - self.container_name = None - self.snapshot_path = 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, - *, - 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(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.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(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.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 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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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 autologger_settings: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :vartype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :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.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, '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'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'AutologgerSettings'}, - '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': '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, - services: Optional[Dict[str, "JobService"]] = None, - autologger_settings: Optional["AutologgerSettings"] = 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["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 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 autologger_settings: Distribution configuration of the job. If set, this should be one - of Mpi, Tensorflow, PyTorch, or null. - :paramtype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :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.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, services=services, **kwargs) - self.job_type = 'Command' # type: str - self.autologger_settings = autologger_settings - 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 ComponentContainer(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.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(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.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.ComputeProvisioningState - :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}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'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, - description: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword properties: Properties of ComputeInstance. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties - :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 - """ - super(ComputeInstance, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'ComputeInstance' # type: str - self.compute_location = None - 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 = 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, - *, - 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 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'}, - '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, - 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 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.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", "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 - :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", "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 - :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", "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 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'}, - '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", - personal_compute_instance_settings: Optional["PersonalComputeInstanceSettings"] = None, - setup_scripts: Optional["SetupScripts"] = None, - idle_time_before_shutdown: Optional[str] = None, - enable_node_public_ip: Optional[bool] = 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 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 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 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.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 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 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: Possible values include: "Recurrence", "Cron". - :vartype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :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 - :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, "TriggerType"]] = 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: Possible values include: "Recurrence", "Cron". - :paramtype trigger_type: str or ~azure.mgmt.machinelearningservices.models.TriggerType - :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 - :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 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 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, '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 CsvExportSummary(ExportSummary): - """CsvExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CsvExportSummary, self).__init__(**kwargs) - self.format = 'CSV' # type: str - self.container_name = None - self.snapshot_path = None - - -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", "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, '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 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] - """ - - _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]'}, - } - - 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, - **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] - """ - 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 - - -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.ComputeProvisioningState - :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}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'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, - description: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword properties: Properties of Databricks. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties - :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 - """ - super(Databricks, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'Databricks' # type: str - self.compute_location = None - 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 = 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, - *, - 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 DataContainer(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.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 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.ComputeProvisioningState - :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}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'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, - *, - description: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :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 - """ - super(DataFactory, self).__init__(description=description, resource_id=resource_id, **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.ComputeProvisioningState - :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}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'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, - description: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties - :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 - """ - super(DataLakeAnalytics, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'DataLakeAnalytics' # type: str - self.compute_location = None - 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 = 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, - *, - 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 DatasetExportSummary(ExportSummary): - """DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar labeled_asset_name: The unique name of the labeled data asset. - :vartype labeled_asset_name: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'labeled_asset_name': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'labeled_asset_name': {'key': 'labeledAssetName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatasetExportSummary, self).__init__(**kwargs) - self.format = 'Dataset' # type: str - self.labeled_asset_name = None - - -class Datastore(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.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(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.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. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001Preview.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', '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. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001Preview.Assets.DataVersionBase.DataType. - :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 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 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 EncryptionKeyVaultProperties(msrest.serialization.Model): - """EncryptionKeyVaultProperties. - - 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(EncryptionKeyVaultProperties, 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 EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): - """EncryptionKeyVaultUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_identifier: Required. Key Vault uri to access the encryption key. - :vartype key_identifier: str - """ - - _validation = { - 'key_identifier': {'required': True}, - } - - _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - } - - def __init__( - self, - *, - key_identifier: str, - **kwargs - ): - """ - :keyword key_identifier: Required. Key Vault uri to access the encryption key. - :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 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.EncryptionKeyVaultProperties - """ - - _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': 'EncryptionKeyVaultProperties'}, - } - - def __init__( - self, - *, - status: Union[str, "EncryptionStatus"], - key_vault_properties: "EncryptionKeyVaultProperties", - identity: Optional["IdentityForCmk"] = 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.EncryptionKeyVaultProperties - """ - super(EncryptionProperty, self).__init__(**kwargs) - self.status = status - self.identity = identity - self.key_vault_properties = key_vault_properties - - -class EncryptionUpdateProperties(msrest.serialization.Model): - """EncryptionUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_vault_properties: Required. Customer Key vault properties. - :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. Customer Key vault properties. - :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 ScheduleActionBase(msrest.serialization.Model): - """ScheduleActionBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobScheduleAction, 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". - :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', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ScheduleActionBase, self).__init__(**kwargs) - self.action_type = None # type: Optional[str] - - -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". - :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(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.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(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.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 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 - """ - - _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'}, - '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'}, - } - - 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(EnvironmentVersionProperties, 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 - self.provisioning_state = 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, - *, - 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.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 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 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, 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.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - 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 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 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(DatastoreProperties): - """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 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.ComputeProvisioningState - :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}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'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, - description: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword properties: HDInsight compute properties. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties - :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 - """ - super(HDInsight, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'HDInsight' # type: str - self.compute_location = None - 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 = 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, - *, - 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, '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 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 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 images. Possible values include: "docker", "azureml". Default value: "docker". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :ivar reference: Image reference URL. - :vartype reference: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - type: Optional[Union[str, "ImageType"]] = "docker", - reference: 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 images. Possible values include: "docker", "azureml". Default value: "docker". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :keyword reference: Image reference URL. - :paramtype reference: str - """ - super(Image, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.type = type - self.reference = reference - - -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. - - :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 - """ - - _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'}, - } - - 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 - - -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 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(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.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". - :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 set by user. - :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 set by user. - :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 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 - - -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 - - -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 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.ComputeProvisioningState - :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}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'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, - description: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword properties: Properties of Kubernetes. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties - :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 - """ - super(Kubernetes, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'Kubernetes' # type: str - self.compute_location = None - 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 = 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 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 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'}, - '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, - 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 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.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 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 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'}, - '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, - 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 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, 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 LabelCategory(msrest.serialization.Model): - """Label category definition. - - :ivar classes: Dictionary of label classes in this category. - :vartype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :ivar display_name: Display name of the label category. - :vartype display_name: str - :ivar multi_select_enabled: Indicates whether it is allowed to select multiple classes in this - category. - :vartype multi_select_enabled: bool - """ - - _attribute_map = { - 'classes': {'key': 'classes', 'type': '{LabelClass}'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'multi_select_enabled': {'key': 'multiSelectEnabled', 'type': 'bool'}, - } - - def __init__( - self, - *, - classes: Optional[Dict[str, "LabelClass"]] = None, - display_name: Optional[str] = None, - multi_select_enabled: Optional[bool] = False, - **kwargs - ): - """ - :keyword classes: Dictionary of label classes in this category. - :paramtype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :keyword display_name: Display name of the label category. - :paramtype display_name: str - :keyword multi_select_enabled: Indicates whether it is allowed to select multiple classes in - this category. - :paramtype multi_select_enabled: bool - """ - super(LabelCategory, self).__init__(**kwargs) - self.classes = classes - self.display_name = display_name - self.multi_select_enabled = multi_select_enabled - - -class LabelClass(msrest.serialization.Model): - """Label class definition. - - :ivar display_name: Display name of the label class. - :vartype display_name: str - :ivar subclasses: Dictionary of subclasses of the label class. - :vartype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, - } - - def __init__( - self, - *, - display_name: Optional[str] = None, - subclasses: Optional[Dict[str, "LabelClass"]] = None, - **kwargs - ): - """ - :keyword display_name: Display name of the label class. - :paramtype display_name: str - :keyword subclasses: Dictionary of subclasses of the label class. - :paramtype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - super(LabelClass, self).__init__(**kwargs) - self.display_name = display_name - self.subclasses = subclasses - - -class LabelingDataConfiguration(msrest.serialization.Model): - """Labeling data configuration definition. - - :ivar data_id: Resource Id of the data asset to perform labeling. - :vartype data_id: str - :ivar incremental_data_refresh_enabled: Indicates whether to enable incremental data refresh. - :vartype incremental_data_refresh_enabled: bool - """ - - _attribute_map = { - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'incremental_data_refresh_enabled': {'key': 'incrementalDataRefreshEnabled', 'type': 'bool'}, - } - - def __init__( - self, - *, - data_id: Optional[str] = None, - incremental_data_refresh_enabled: Optional[bool] = False, - **kwargs - ): - """ - :keyword data_id: Resource Id of the data asset to perform labeling. - :paramtype data_id: str - :keyword incremental_data_refresh_enabled: Indicates whether to enable incremental data - refresh. - :paramtype incremental_data_refresh_enabled: bool - """ - super(LabelingDataConfiguration, self).__init__(**kwargs) - self.data_id = data_id - self.incremental_data_refresh_enabled = incremental_data_refresh_enabled - - -class LabelingJob(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.LabelingJobProperties - """ - - _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': 'LabelingJobProperties'}, - } - - def __init__( - self, - *, - properties: "LabelingJobProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - super(LabelingJob, self).__init__(**kwargs) - self.properties = properties - - -class LabelingJobMediaProperties(msrest.serialization.Model): - """Properties of a labeling job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LabelingJobImageProperties, LabelingJobTextProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - } - - _subtype_map = { - 'media_type': {'Image': 'LabelingJobImageProperties', 'Text': 'LabelingJobTextProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(LabelingJobMediaProperties, self).__init__(**kwargs) - self.media_type = None # type: Optional[str] - - -class LabelingJobImageProperties(LabelingJobMediaProperties): - """Properties of a labeling job for image data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - *, - annotation_type: Optional[Union[str, "ImageAnnotationType"]] = None, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - super(LabelingJobImageProperties, self).__init__(**kwargs) - self.media_type = 'Image' # type: str - self.annotation_type = annotation_type - - -class LabelingJobInstructions(msrest.serialization.Model): - """Instructions for labeling job. - - :ivar uri: The link to a page with detailed labeling instructions for labelers. - :vartype uri: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: Optional[str] = None, - **kwargs - ): - """ - :keyword uri: The link to a page with detailed labeling instructions for labelers. - :paramtype uri: str - """ - super(LabelingJobInstructions, self).__init__(**kwargs) - self.uri = uri - - -class LabelingJobProperties(JobBaseProperties): - """Labeling 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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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 created_date_time: Created time of the job in UTC timezone. - :vartype created_date_time: ~datetime.datetime - :ivar data_configuration: Configuration of data used in the job. - :vartype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :ivar job_instructions: Labeling instructions of the job. - :vartype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :ivar label_categories: Label categories of the job. - :vartype label_categories: dict[str, ~azure.mgmt.machinelearningservices.models.LabelCategory] - :ivar labeling_job_media_properties: Media type specific properties in the job. - :vartype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :ivar ml_assist_configuration: Configuration of MLAssist feature in the job. - :vartype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - :ivar progress_metrics: Progress metrics of the job. - :vartype progress_metrics: ~azure.mgmt.machinelearningservices.models.ProgressMetrics - :ivar project_id: Internal id of the job(Previously called project). - :vartype project_id: str - :ivar provisioning_state: Specifies the labeling job provisioning state. Possible values - include: "Succeeded", "Failed", "Canceled", "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.JobProvisioningState - :ivar status_messages: Status messages of the job. - :vartype status_messages: list[~azure.mgmt.machinelearningservices.models.StatusMessage] - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'progress_metrics': {'readonly': True}, - 'project_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status_messages': {'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'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'data_configuration': {'key': 'dataConfiguration', 'type': 'LabelingDataConfiguration'}, - 'job_instructions': {'key': 'jobInstructions', 'type': 'LabelingJobInstructions'}, - 'label_categories': {'key': 'labelCategories', 'type': '{LabelCategory}'}, - 'labeling_job_media_properties': {'key': 'labelingJobMediaProperties', 'type': 'LabelingJobMediaProperties'}, - 'ml_assist_configuration': {'key': 'mlAssistConfiguration', 'type': 'MLAssistConfiguration'}, - 'progress_metrics': {'key': 'progressMetrics', 'type': 'ProgressMetrics'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status_messages': {'key': 'statusMessages', 'type': '[StatusMessage]'}, - } - - 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, - services: Optional[Dict[str, "JobService"]] = None, - data_configuration: Optional["LabelingDataConfiguration"] = None, - job_instructions: Optional["LabelingJobInstructions"] = None, - label_categories: Optional[Dict[str, "LabelCategory"]] = None, - labeling_job_media_properties: Optional["LabelingJobMediaProperties"] = None, - ml_assist_configuration: Optional["MLAssistConfiguration"] = 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 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_configuration: Configuration of data used in the job. - :paramtype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :keyword job_instructions: Labeling instructions of the job. - :paramtype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :keyword label_categories: Label categories of the job. - :paramtype label_categories: dict[str, - ~azure.mgmt.machinelearningservices.models.LabelCategory] - :keyword labeling_job_media_properties: Media type specific properties in the job. - :paramtype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :keyword ml_assist_configuration: Configuration of MLAssist feature in the job. - :paramtype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - """ - super(LabelingJobProperties, 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, services=services, **kwargs) - self.job_type = 'Labeling' # type: str - self.created_date_time = None - self.data_configuration = data_configuration - self.job_instructions = job_instructions - self.label_categories = label_categories - self.labeling_job_media_properties = labeling_job_media_properties - self.ml_assist_configuration = ml_assist_configuration - self.progress_metrics = None - self.project_id = None - self.provisioning_state = None - self.status_messages = None - - -class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of LabelingJob entities. - - :ivar next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type LabelingJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[LabelingJob]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["LabelingJob"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type LabelingJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - super(LabelingJobResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class LabelingJobTextProperties(LabelingJobMediaProperties): - """Properties of a labeling job for text data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - *, - annotation_type: Optional[Union[str, "TextAnnotationType"]] = None, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - super(LabelingJobTextProperties, self).__init__(**kwargs) - self.media_type = 'Text' # type: str - self.annotation_type = annotation_type - - -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 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, '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 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. - :vartype category: str - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, - } - - def __init__( - self, - *, - category: Optional[str] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionManagedIdentity"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. - :paramtype category: str - :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 credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = credentials - - -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 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 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'}, - '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, - 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 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, 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 MLAssistConfiguration(msrest.serialization.Model): - """Labeling MLAssist configuration definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLAssistConfigurationDisabled, MLAssistConfigurationEnabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - _subtype_map = { - 'ml_assist': {'Disabled': 'MLAssistConfigurationDisabled', 'Enabled': 'MLAssistConfigurationEnabled'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfiguration, self).__init__(**kwargs) - self.ml_assist = None # type: Optional[str] - - -class MLAssistConfigurationDisabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is disabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfigurationDisabled, self).__init__(**kwargs) - self.ml_assist = 'Disabled' # type: str - - -class MLAssistConfigurationEnabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is enabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - :ivar inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :vartype inferencing_compute_binding: str - :ivar training_compute_binding: Required. [Required] AML compute binding used in training. - :vartype training_compute_binding: str - """ - - _validation = { - 'ml_assist': {'required': True}, - 'inferencing_compute_binding': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_compute_binding': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - 'inferencing_compute_binding': {'key': 'inferencingComputeBinding', 'type': 'str'}, - 'training_compute_binding': {'key': 'trainingComputeBinding', 'type': 'str'}, - } - - def __init__( - self, - *, - inferencing_compute_binding: str, - training_compute_binding: str, - **kwargs - ): - """ - :keyword inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :paramtype inferencing_compute_binding: str - :keyword training_compute_binding: Required. [Required] AML compute binding used in training. - :paramtype training_compute_binding: str - """ - super(MLAssistConfigurationEnabled, self).__init__(**kwargs) - self.ml_assist = 'Enabled' # type: str - self.inferencing_compute_binding = inferencing_compute_binding - self.training_compute_binding = training_compute_binding - - -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, '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. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001Preview.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.V20221001Preview.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", "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, '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(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.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 ModelVersion(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.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 - """ - - _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'}, - } - - 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, - **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 - """ - 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 - - -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 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 NlpFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML NLP training. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: int - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: int - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: int - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: int - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: float - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: float - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'float'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - *, - gradient_accumulation_steps: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "NlpLearningRateScheduler"]] = None, - model_name: Optional[str] = None, - number_of_epochs: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_ratio: Optional[float] = None, - weight_decay: Optional[float] = None, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: int - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: int - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: int - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: int - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: float - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: float - """ - super(NlpFixedParameters, self).__init__(**kwargs) - self.gradient_accumulation_steps = gradient_accumulation_steps - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.number_of_epochs = number_of_epochs - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_ratio = warmup_ratio - self.weight_decay = weight_decay - - -class NlpParameterSubspace(msrest.serialization.Model): - """Stringified search spaces for each parameter. See below examples. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :vartype learning_rate_scheduler: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: str - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: str - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: str - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: str - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: str - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - *, - gradient_accumulation_steps: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - number_of_epochs: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_ratio: Optional[str] = None, - weight_decay: Optional[str] = None, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :paramtype learning_rate_scheduler: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: str - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: str - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: str - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: str - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: str - """ - super(NlpParameterSubspace, self).__init__(**kwargs) - self.gradient_accumulation_steps = gradient_accumulation_steps - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.number_of_epochs = number_of_epochs - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_ratio = warmup_ratio - self.weight_decay = weight_decay - - -class NlpSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter tuning related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. 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 for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(NlpSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.sampling_algorithm = sampling_algorithm - - -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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - } - - def __init__( - self, - *, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_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_nodes: Maximum nodes to leverage for training in any single trial. Controls - multi-node distributed training. - :vartype max_nodes: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Timeout for individual HD trials. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_trials: Optional[int] = 1, - max_nodes: Optional[int] = 1, - max_trials: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "P7D", - trial_timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_nodes: Maximum nodes to leverage for training in any single trial. Controls - multi-node distributed training. - :paramtype max_nodes: int - :keyword max_trials: Number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Timeout for individual HD trials. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = max_concurrent_trials - self.max_nodes = max_nodes - self.max_trials = max_trials - self.timeout = timeout - self.trial_timeout = trial_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. - - 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. - :vartype category: str - :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 - """ - - _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'}, - } - - def __init__( - self, - *, - category: Optional[str] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. - :paramtype category: str - :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 - """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **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", "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 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 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 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: 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 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 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.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: any - :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': 'object'}, - '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[Any] = 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: any - :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.kind = kind - self.location = location - self.properties = properties - 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. - - 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. - :vartype category: str - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, - } - - def __init__( - self, - *, - category: Optional[str] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionPersonalAccessToken"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. - :paramtype category: str - :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 credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = credentials - - -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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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 - :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'}, - '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, - 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 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, 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 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 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 - :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'}, - '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'}, - '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["ManagedServiceIdentity"] = 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.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 - :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.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 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 - :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'}, - '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'}, - '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, - 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.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 - :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.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 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 ProgressMetrics(msrest.serialization.Model): - """Progress metrics definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar completed_datapoint_count: The completed datapoint count. - :vartype completed_datapoint_count: long - :ivar incremental_data_last_refresh_date_time: The time of last successful incremental data - refresh in UTC. - :vartype incremental_data_last_refresh_date_time: ~datetime.datetime - :ivar skipped_datapoint_count: The skipped datapoint count. - :vartype skipped_datapoint_count: long - :ivar total_datapoint_count: The total datapoint count. - :vartype total_datapoint_count: long - """ - - _validation = { - 'completed_datapoint_count': {'readonly': True}, - 'incremental_data_last_refresh_date_time': {'readonly': True}, - 'skipped_datapoint_count': {'readonly': True}, - 'total_datapoint_count': {'readonly': True}, - } - - _attribute_map = { - 'completed_datapoint_count': {'key': 'completedDatapointCount', 'type': 'long'}, - 'incremental_data_last_refresh_date_time': {'key': 'incrementalDataLastRefreshDateTime', 'type': 'iso-8601'}, - 'skipped_datapoint_count': {'key': 'skippedDatapointCount', 'type': 'long'}, - 'total_datapoint_count': {'key': 'totalDatapointCount', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProgressMetrics, self).__init__(**kwargs) - self.completed_datapoint_count = None - self.incremental_data_last_refresh_date_time = None - self.skipped_datapoint_count = None - self.total_datapoint_count = 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, - *, - 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 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 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.RecurrenceFrequency - :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.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] = "UTC", - schedule: Optional["RecurrenceSchedule"] = 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.RecurrenceFrequency - :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.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): - """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 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 properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RegistryProperties - :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': 'RegistryProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "RegistryProperties", - 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.RegistryProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(Registry, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -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 RegistryProperties(ResourceBase): - """Details of the Registry. - - :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 public_network_access: - :vartype public_network_access: str - :ivar discovery_url: - :vartype discovery_url: str - :ivar intellectual_property_publisher: - :vartype intellectual_property_publisher: str - :ivar managed_resource_group: Managed resource group created for the registry. - :vartype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar ml_flow_registry_uri: - :vartype ml_flow_registry_uri: str - :ivar private_link_count: - :vartype private_link_count: int - :ivar region_details: Details of each region the registry is in. - :vartype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - :ivar managed_resource_group_tags: Tags to be applied to the managed resource group associated - with this registry. - :vartype managed_resource_group_tags: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'discovery_url': {'key': 'discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'managedResourceGroup', 'type': 'ArmResourceId'}, - 'ml_flow_registry_uri': {'key': 'mlFlowRegistryUri', 'type': 'str'}, - 'private_link_count': {'key': 'privateLinkCount', 'type': 'int'}, - 'region_details': {'key': 'regionDetails', 'type': '[RegistryRegionArmDetails]'}, - 'managed_resource_group_tags': {'key': 'managedResourceGroupTags', 'type': '{str}'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - public_network_access: Optional[str] = None, - discovery_url: Optional[str] = None, - intellectual_property_publisher: Optional[str] = None, - managed_resource_group: Optional["ArmResourceId"] = None, - ml_flow_registry_uri: Optional[str] = None, - private_link_count: Optional[int] = None, - region_details: Optional[List["RegistryRegionArmDetails"]] = None, - managed_resource_group_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 public_network_access: - :paramtype public_network_access: str - :keyword discovery_url: - :paramtype discovery_url: str - :keyword intellectual_property_publisher: - :paramtype intellectual_property_publisher: str - :keyword managed_resource_group: Managed resource group created for the registry. - :paramtype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword ml_flow_registry_uri: - :paramtype ml_flow_registry_uri: str - :keyword private_link_count: - :paramtype private_link_count: int - :keyword region_details: Details of each region the registry is in. - :paramtype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - :keyword managed_resource_group_tags: Tags to be applied to the managed resource group - associated with this registry. - :paramtype managed_resource_group_tags: dict[str, str] - """ - super(RegistryProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.public_network_access = public_network_access - self.discovery_url = discovery_url - self.intellectual_property_publisher = intellectual_property_publisher - self.managed_resource_group = managed_resource_group - self.ml_flow_registry_uri = ml_flow_registry_uri - self.private_link_count = private_link_count - self.region_details = region_details - self.managed_resource_group_tags = managed_resource_group_tags - - -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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, 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.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - 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 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 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 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. - :vartype category: str - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, - } - - def __init__( - self, - *, - category: Optional[str] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionSharedAccessSignature"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. - :paramtype category: str - :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 credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = credentials - - -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 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(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.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: 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: 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 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. - :vartype category: str - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, - } - - def __init__( - self, - *, - category: Optional[str] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionServicePrincipal"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. - :paramtype category: str - :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 credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **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", "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 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 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): - """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 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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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 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 resource 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 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 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, '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'}, - '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'}, - '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]'}, - '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, - 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, - 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, - 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 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 resource 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 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 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, 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.files = files - self.inputs = inputs - self.jars = jars - self.outputs = outputs - self.py_files = py_files - 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 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 StatusMessage(msrest.serialization.Model): - """Active message associated with project. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Service-defined message code. - :vartype code: str - :ivar created_date_time: Time in UTC at which the message was created. - :vartype created_date_time: ~datetime.datetime - :ivar level: Severity level of message. Possible values include: "Error", "Information", - "Warning". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.StatusMessageLevel - :ivar message: A human-readable representation of the message code. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(StatusMessage, self).__init__(**kwargs) - self.code = None - self.created_date_time = None - self.level = None - self.message = None - - -class StorageAccountDetails(msrest.serialization.Model): - """Details of storage account to be used for the Registry. - - :ivar system_created_storage_account: - :vartype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :ivar user_created_storage_account: - :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: - :paramtype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :keyword user_created_storage_account: - :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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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}'}, - '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'}, - '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, - 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, - 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 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 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, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, 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 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.ComputeProvisioningState - :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}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'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, - *, - description: Optional[str] = None, - resource_id: Optional[str] = None, - properties: Optional["SynapseSparkProperties"] = None, - **kwargs - ): - """ - :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 properties: - :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties - """ - super(SynapseSpark, self).__init__(description=description, resource_id=resource_id, **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_sku: - :vartype acr_account_sku: str - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - *, - acr_account_sku: Optional[str] = None, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs - ): - """ - :keyword acr_account_sku: - :paramtype acr_account_sku: str - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(SystemCreatedAcrAccount, self).__init__(**kwargs) - self.acr_account_sku = acr_account_sku - self.arm_resource_id = arm_resource_id - - -class SystemCreatedStorageAccount(msrest.serialization.Model): - """SystemCreatedStorageAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar storage_account_hns_enabled: - :vartype storage_account_hns_enabled: bool - :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 = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - } - - def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - storage_account_hns_enabled: Optional[bool] = None, - storage_account_type: Optional[str] = None, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword storage_account_hns_enabled: - :paramtype storage_account_hns_enabled: bool - :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.arm_resource_id = arm_resource_id - self.storage_account_hns_enabled = storage_account_hns_enabled - 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 TableFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML Table training. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: int - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: int - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: int - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: int - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: float - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: int - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: int - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: float - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: float - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: float - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: float - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: bool - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: bool - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'max_bin': {'key': 'maxBin', 'type': 'int'}, - 'max_depth': {'key': 'maxDepth', 'type': 'int'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'int'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'int'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'float'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'int'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'int'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'float'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'float'}, - 'subsample': {'key': 'subsample', 'type': 'float'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'float'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'bool'}, - 'with_std': {'key': 'withStd', 'type': 'bool'}, - } - - def __init__( - self, - *, - booster: Optional[str] = None, - boosting_type: Optional[str] = None, - grow_policy: Optional[str] = None, - learning_rate: Optional[float] = None, - max_bin: Optional[int] = None, - max_depth: Optional[int] = None, - max_leaves: Optional[int] = None, - min_data_in_leaf: Optional[int] = None, - min_split_gain: Optional[float] = None, - model_name: Optional[str] = None, - n_estimators: Optional[int] = None, - num_leaves: Optional[int] = None, - preprocessor_name: Optional[str] = None, - reg_alpha: Optional[float] = None, - reg_lambda: Optional[float] = None, - subsample: Optional[float] = None, - subsample_freq: Optional[float] = None, - tree_method: Optional[str] = None, - with_mean: Optional[bool] = False, - with_std: Optional[bool] = False, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: int - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: int - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: int - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: int - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: float - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: int - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: int - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: float - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: float - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: float - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: float - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: bool - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: bool - """ - super(TableFixedParameters, self).__init__(**kwargs) - self.booster = booster - self.boosting_type = boosting_type - self.grow_policy = grow_policy - self.learning_rate = learning_rate - self.max_bin = max_bin - self.max_depth = max_depth - self.max_leaves = max_leaves - self.min_data_in_leaf = min_data_in_leaf - self.min_split_gain = min_split_gain - self.model_name = model_name - self.n_estimators = n_estimators - self.num_leaves = num_leaves - self.preprocessor_name = preprocessor_name - self.reg_alpha = reg_alpha - self.reg_lambda = reg_lambda - self.subsample = subsample - self.subsample_freq = subsample_freq - self.tree_method = tree_method - self.with_mean = with_mean - self.with_std = with_std - - -class TableParameterSubspace(msrest.serialization.Model): - """TableParameterSubspace. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: str - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: str - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: str - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: str - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: str - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: str - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: str - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: str - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: str - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: str - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: str - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: str - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'max_bin': {'key': 'maxBin', 'type': 'str'}, - 'max_depth': {'key': 'maxDepth', 'type': 'str'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'str'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'str'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'str'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'str'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'str'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'str'}, - 'subsample': {'key': 'subsample', 'type': 'str'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'str'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'str'}, - 'with_std': {'key': 'withStd', 'type': 'str'}, - } - - def __init__( - self, - *, - booster: Optional[str] = None, - boosting_type: Optional[str] = None, - grow_policy: Optional[str] = None, - learning_rate: Optional[str] = None, - max_bin: Optional[str] = None, - max_depth: Optional[str] = None, - max_leaves: Optional[str] = None, - min_data_in_leaf: Optional[str] = None, - min_split_gain: Optional[str] = None, - model_name: Optional[str] = None, - n_estimators: Optional[str] = None, - num_leaves: Optional[str] = None, - preprocessor_name: Optional[str] = None, - reg_alpha: Optional[str] = None, - reg_lambda: Optional[str] = None, - subsample: Optional[str] = None, - subsample_freq: Optional[str] = None, - tree_method: Optional[str] = None, - with_mean: Optional[str] = None, - with_std: Optional[str] = None, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: str - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: str - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: str - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: str - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: str - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: str - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: str - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: str - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: str - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: str - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: str - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: str - """ - super(TableParameterSubspace, self).__init__(**kwargs) - self.booster = booster - self.boosting_type = boosting_type - self.grow_policy = grow_policy - self.learning_rate = learning_rate - self.max_bin = max_bin - self.max_depth = max_depth - self.max_leaves = max_leaves - self.min_data_in_leaf = min_data_in_leaf - self.min_split_gain = min_split_gain - self.model_name = model_name - self.n_estimators = n_estimators - self.num_leaves = num_leaves - self.preprocessor_name = preprocessor_name - self.reg_alpha = reg_alpha - self.reg_lambda = reg_lambda - self.subsample = subsample - self.subsample_freq = subsample_freq - self.tree_method = tree_method - self.with_mean = with_mean - self.with_std = with_std - - -class TableSweepSettings(msrest.serialization.Model): - """TableSweepSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. 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 for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(TableSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.sampling_algorithm = sampling_algorithm - - -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 sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to trigger. - :vartype sweep_concurrent_trials: int - :ivar sweep_trials: Number of sweeping runs that user wants to trigger. - :vartype sweep_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'}, - 'sweep_concurrent_trials': {'key': 'sweepConcurrentTrials', 'type': 'int'}, - 'sweep_trials': {'key': 'sweepTrials', '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, - sweep_concurrent_trials: Optional[int] = 0, - sweep_trials: Optional[int] = 0, - 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 sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to - trigger. - :paramtype sweep_concurrent_trials: int - :keyword sweep_trials: Number of sweeping runs that user wants to trigger. - :paramtype sweep_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.sweep_concurrent_trials = sweep_concurrent_trials - self.sweep_trials = sweep_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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - '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, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - '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, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - '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, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_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 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, '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, '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. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001Preview.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.V20221001Preview.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 = '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, '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. Usage/meaning depends on - Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001Preview.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.V20221001Preview.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 = '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, '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. - - 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. - :vartype category: str - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, - } - - def __init__( - self, - *, - category: Optional[str] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionUsernamePassword"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. - :paramtype category: str - :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 credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **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.ComputeProvisioningState - :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}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'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, - description: Optional[str] = None, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties - :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 - """ - super(VirtualMachine, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) - self.properties = properties - self.compute_type = 'VirtualMachine' # type: str - self.compute_location = None - 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 = 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, - *, - 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: 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 - :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. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. - :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", - "SoftDeleted". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.WorkspaceProvisioningState - :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 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 - :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 soft_deleted_at: The timestamp when the workspace was soft deleted. - :vartype soft_deleted_at: str - :ivar scheduled_purge_date: The timestamp when the soft deleted workspace is going to be - purged. - :vartype scheduled_purge_date: 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}, - 'soft_deleted_at': {'readonly': True}, - 'scheduled_purge_date': {'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'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - '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'}, - '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'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'soft_deleted_at': {'key': 'properties.softDeletedAt', 'type': 'str'}, - 'scheduled_purge_date': {'key': 'properties.scheduledPurgeDate', 'type': 'str'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = 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, - 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, - v1_legacy_mode: Optional[bool] = False, - **kwargs - ): - """ - :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 - :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. - :paramtype application_insights: str - :keyword container_registry: ARM id of the container registry associated with this workspace. - :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 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 - :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(Workspace, self).__init__(**kwargs) - self.identity = identity - self.location = location - self.tags = tags - self.sku = sku - 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.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 - self.v1_legacy_mode = v1_legacy_mode - self.soft_deleted_at = None - self.scheduled_purge_date = 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 WorkspaceConnectionManagedIdentity(msrest.serialization.Model): - """WorkspaceConnectionManagedIdentity. - - :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(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.resource_id = resource_id - self.client_id = client_id - - -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. - - 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 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 WorkspaceConnectionUsernamePassword(msrest.serialization.Model): - """WorkspaceConnectionUsernamePassword. - - :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(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.username = username - self.password = password - - -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.ManagedServiceIdentity - :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 - :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 encryption: The encryption settings of the workspace. - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - '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'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionUpdateProperties'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - sku: Optional["Sku"] = None, - identity: Optional["ManagedServiceIdentity"] = 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, - application_insights: Optional[str] = None, - container_registry: Optional[str] = None, - encryption: Optional["EncryptionUpdateProperties"] = 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.ManagedServiceIdentity - :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 - :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 encryption: The encryption settings of the workspace. - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - """ - 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 - self.application_insights = application_insights - self.container_registry = container_registry - self.encryption = encryption diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/__init__.py deleted file mode 100644 index 01fa2d886d14..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/__init__.py +++ /dev/null @@ -1,85 +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 ._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_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 ._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 ._labeling_jobs_operations import LabelingJobsOperations -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 - -__all__ = [ - 'Operations', - 'WorkspacesOperations', - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'WorkspaceConnectionsOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'JobsOperations', - 'LabelingJobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_deployments_operations.py deleted file mode 100644 index cc437c31c4ca..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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', "2022-10-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', "2022-10-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, **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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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, **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/v2022_10_01_preview/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_endpoints_operations.py deleted file mode 100644 index ecfd3ea617d3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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', "2022-10-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', "2022-10-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, **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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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, **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', "2022-10-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/v2022_10_01_preview/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_containers_operations.py deleted file mode 100644 index 254317233f79..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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/v2022_10_01_preview/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_versions_operations.py deleted file mode 100644 index 17a29c3b389e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_versions_operations.py +++ /dev/null @@ -1,552 +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 - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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}/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'), - "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 = kwargs.pop('api_version', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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 - """ - api_version = kwargs.pop('api_version', "2022-10-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, - 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, - 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', "2022-10-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', "2022-10-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', "2022-10-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_containers_operations.py deleted file mode 100644 index 2568cbe99064..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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/v2022_10_01_preview/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_versions_operations.py deleted file mode 100644 index 45ae72b476f5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_versions_operations.py +++ /dev/null @@ -1,560 +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 - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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 - """ - api_version = kwargs.pop('api_version', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_compute_operations.py deleted file mode 100644 index fc67fc0cfc9d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_compute_operations.py +++ /dev/null @@ -1,1718 +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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-10-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'), - "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 - api_version = kwargs.pop('api_version', "2022-10-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'), - "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 - api_version = kwargs.pop('api_version', "2022-10-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'), - "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 - api_version = kwargs.pop('api_version', "2022-10-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'), - "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_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', "2022-10-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'), - "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="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', "2022-10-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'), - "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 = kwargs.pop('api_version', "2022-10-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'), - "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 = kwargs.pop('api_version', "2022-10-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'), - "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 = kwargs.pop('api_version', "2022-10-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'), - "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 = kwargs.pop('api_version', "2022-10-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'), - "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_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', "2022-10-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'), - "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="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 - """ - api_version = kwargs.pop('api_version', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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 - - - 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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_containers_operations.py deleted file mode 100644 index e809b6cc7a71..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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/v2022_10_01_preview/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_versions_operations.py deleted file mode 100644 index eae182ebdb75..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_versions_operations.py +++ /dev/null @@ -1,572 +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 - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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 - """ - api_version = kwargs.pop('api_version', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_datastores_operations.py deleted file mode 100644 index 24fe3fbf1f80..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_datastores_operations.py +++ /dev/null @@ -1,671 +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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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}/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'), - "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 - """ - api_version = kwargs.pop('api_version', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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 - **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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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, - name=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('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_10_01_preview/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_containers_operations.py deleted file mode 100644 index 9234f37eb34a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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/v2022_10_01_preview/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_versions_operations.py deleted file mode 100644 index 167bbc040c85..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_versions_operations.py +++ /dev/null @@ -1,560 +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 - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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 - """ - api_version = kwargs.pop('api_version', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_jobs_operations.py deleted file mode 100644 index a3a443e03453..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_jobs_operations.py +++ /dev/null @@ -1,771 +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', "2022-10-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"]] - scheduled = kwargs.pop('scheduled', None) # type: Optional[bool] - schedule_id = kwargs.pop('schedule_id', 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'), - } - - _url = _format_url_section(_url, **path_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 = kwargs.pop('api_version', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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 - """ - api_version = kwargs.pop('api_version', "2022-10-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, - 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, - api_version=api_version, - 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( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=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', "2022-10-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', "2022-10-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, **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', "2022-10-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. - - 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.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', "2022-10-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', "2022-10-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', "2022-10-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/v2022_10_01_preview/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_labeling_jobs_operations.py deleted file mode 100644 index 6fb608de455b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_labeling_jobs_operations.py +++ /dev/null @@ -1,1044 +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', "2022-10-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - count = kwargs.pop('count', None) # type: Optional[int] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "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') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: 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 - id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{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'), - "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', "2022-10-01-preview") # type: str - include_job_instructions = kwargs.pop('include_job_instructions', False) # type: Optional[bool] - include_label_categories = kwargs.pop('include_label_categories', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{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'), - "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') - if include_job_instructions is not None: - _query_parameters['includeJobInstructions'] = _SERIALIZER.query("include_job_instructions", include_job_instructions, 'bool') - if include_label_categories is not None: - _query_parameters['includeLabelCategories'] = _SERIALIZER.query("include_label_categories", include_label_categories, '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_create_or_update_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', "2022-10-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}/labelingJobs/{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'), - "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_export_labels_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', "2022-10-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}/labelingJobs/{id}/exportLabels") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "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] - 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_pause_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', "2022-10-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "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 - ) - - -def build_resume_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', "2022-10-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "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 LabelingJobsOperations(object): - """LabelingJobsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration 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] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.LabelingJobResourceArmPaginatedResult"] - """Lists labeling jobs in the workspace. - - Lists labeling 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 count: Number of labeling jobs to return. - :type count: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LabelingJobResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 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, - 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, - 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("LabelingJobResourceArmPaginatedResult", 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}/labelingJobs"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete a labeling job. - - Delete a labeling 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 LabelingJob. - :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', {})) - - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - - - request = build_delete_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.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}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - include_job_instructions=False, # type: Optional[bool] - include_label_categories=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> "_models.LabelingJob" - """Gets a labeling job by name/id. - - Gets a labeling 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 LabelingJob. - :type id: str - :param include_job_instructions: Boolean value to indicate whether to include JobInstructions - in response. - :type include_job_instructions: bool - :param include_label_categories: Boolean value to indicate Whether to include LabelCategories - in response. - :type include_label_categories: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LabelingJob, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJob - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2022-10-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, - include_job_instructions=include_job_instructions, - include_label_categories=include_label_categories, - 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('LabelingJob', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.LabelingJob" - **kwargs # type: Any - ): - # type: (...) -> "_models.LabelingJob" - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'LabelingJob') - - request = build_create_or_update_request_initial( - 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_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('LabelingJob', 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('LabelingJob', 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}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.LabelingJob" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.LabelingJob"] - """Creates or updates a labeling job (asynchronous). - - Creates or updates a labeling 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 LabelingJob. - :type id: str - :param body: LabelingJob definition object. - :type body: ~azure.mgmt.machinelearningservices.models.LabelingJob - :keyword callable cls: A custom type or function that will be passed the direct response - :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 LabelingJob or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2022-10-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.LabelingJob"] - lro_delay = kwargs.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, - id=id, - 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('LabelingJob', 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}/labelingJobs/{id}"} # type: ignore - - def _export_labels_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.ExportSummary" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ExportSummary"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExportSummary"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ExportSummary') - - request = build_export_labels_request_initial( - 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._export_labels_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('ExportSummary', 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 - - _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - - @distributed_trace - def begin_export_labels( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.ExportSummary" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ExportSummary"] - """Export labels from a labeling job (asynchronous). - - Export labels from a labeling 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 LabelingJob. - :type id: str - :param body: The export summary. - :type body: ~azure.mgmt.machinelearningservices.models.ExportSummary - :keyword callable cls: A custom type or function that will be passed the direct response - :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 ExportSummary or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2022-10-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.ExportSummary"] - lro_delay = kwargs.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._export_labels_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - 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('ExportSummary', 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_export_labels.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - @distributed_trace - def pause( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Pause a labeling job. - - Pause a labeling 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 LabelingJob. - :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', {})) - - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - - - request = build_pause_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.pause.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, 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, {}) - - pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - - - def _resume_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', "2022-10-01-preview") # type: str - - - request = build_resume_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._resume_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) - - _resume_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore - - - @distributed_trace - def begin_resume( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Resume a labeling job (asynchronous). - - Resume a labeling 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 LabelingJob. - :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', "2022-10-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._resume_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_resume.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_containers_operations.py deleted file mode 100644 index 0d78a86fe090..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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/v2022_10_01_preview/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_versions_operations.py deleted file mode 100644 index cf1c86a89d73..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_versions_operations.py +++ /dev/null @@ -1,610 +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 - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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 - """ - api_version = kwargs.pop('api_version', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_deployments_operations.py deleted file mode 100644 index 4d3d7e29176a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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', "2022-10-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', "2022-10-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, **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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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, **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', "2022-10-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', "2022-10-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/v2022_10_01_preview/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_endpoints_operations.py deleted file mode 100644 index 448697196546..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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', "2022-10-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', "2022-10-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, **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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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, **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', "2022-10-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', "2022-10-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', "2022-10-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 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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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/v2022_10_01_preview/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_operations.py deleted file mode 100644 index 28734bc56724..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_operations.py +++ /dev/null @@ -1,154 +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', "2022-10-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.AmlOperationListResult"] - """Lists all of the available Azure Machine Learning Services 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 AmlOperationListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlOperationListResult"] - error_map = { - 401: ClientAuthenticationError, 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("AmlOperationListResult", 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/v2022_10_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index 58281925f838..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_endpoint_connections_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 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( - resource_group_name, # type: str - workspace_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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 = { - "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 = kwargs.pop('api_version', "2022-10-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'), - "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', "2022-10-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'), - "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 = kwargs.pop('api_version', "2022-10-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'), - "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 - """ - api_version = kwargs.pop('api_version', "2022-10-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( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - 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) - - else: - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - 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("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 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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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 - 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', {})) - - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - 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, - 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 - - - @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 - """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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_link_resources_operations.py deleted file mode 100644 index 1ad9f1900055..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,150 +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( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', {})) - - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - - - 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) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, 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_10_01_preview/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_quotas_operations.py deleted file mode 100644 index d69bf6dfa54f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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', "2022-10-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', "2022-10-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', "2022-10-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/v2022_10_01_preview/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registries_operations.py deleted file mode 100644 index 82b521391f8d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registries_operations.py +++ /dev/null @@ -1,836 +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', "2022-10-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/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') - 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 - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("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_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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', "2022-10-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\-_]{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 - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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\-_]{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 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, - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RegistryTrackedResourceArmPaginatedResult"] - """List registries by subscription. - - List registries by 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 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', "2022-10-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, - 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, - 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("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 - skip=None, # type: Optional[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 - :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 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', "2022-10-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, - 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, - 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("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', "2022-10-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 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', "2022-10-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, **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 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', "2022-10-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 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', "2022-10-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, 202]: - map_error(status_code=response.status_code, 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('Registry', pipeline_response) - - if response.status_code == 202: - 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', "2022-10-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, 202]: - 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 response.status_code == 202: - 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 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', "2022-10-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': '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/registries/{registryName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_containers_operations.py deleted file mode 100644 index 9bb4fac625ba..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-10-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'), - "codeName": _SERIALIZER.url("code_name", code_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 - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - "codeName": _SERIALIZER.url("code_name", code_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 - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - "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. - :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', "2022-10-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', "2022-10-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 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. - :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', "2022-10-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 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. - :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', "2022-10-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', "2022-10-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 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. - :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', "2022-10-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/v2022_10_01_preview/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_versions_operations.py deleted file mode 100644 index b06b751098d6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_versions_operations.py +++ /dev/null @@ -1,681 +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', "2022-10-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'), - "codeName": _SERIALIZER.url("code_name", code_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 - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - "codeName": _SERIALIZER.url("code_name", code_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 - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - "codeName": _SERIALIZER.url("code_name", code_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 - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - "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 - ) - -# 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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_containers_operations.py deleted file mode 100644 index 8b5332d2f1d7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-10-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'), - "componentName": _SERIALIZER.url("component_name", component_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 - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - "componentName": _SERIALIZER.url("component_name", component_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 - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - "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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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/v2022_10_01_preview/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_versions_operations.py deleted file mode 100644 index 5cdbb59cd928..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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'), - "componentName": _SERIALIZER.url("component_name", component_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 - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - "componentName": _SERIALIZER.url("component_name", component_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 - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - "componentName": _SERIALIZER.url("component_name", component_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 - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - "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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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/v2022_10_01_preview/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_containers_operations.py deleted file mode 100644 index 6f2dcc994ef2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-10-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'), - "environmentName": _SERIALIZER.url("environment_name", environment_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 - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - "environmentName": _SERIALIZER.url("environment_name", environment_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 - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - "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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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/v2022_10_01_preview/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_versions_operations.py deleted file mode 100644 index b54f03c1f10d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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'), - "environmentName": _SERIALIZER.url("environment_name", environment_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_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', "2022-10-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'), - "environmentName": _SERIALIZER.url("environment_name", environment_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 - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - "environmentName": _SERIALIZER.url("environment_name", environment_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 - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - "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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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/v2022_10_01_preview/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_containers_operations.py deleted file mode 100644 index a321d4711e16..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-10-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'), - "modelName": _SERIALIZER.url("model_name", model_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 - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - "modelName": _SERIALIZER.url("model_name", model_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 - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - "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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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/v2022_10_01_preview/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_versions_operations.py deleted file mode 100644 index f26bef0104a4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_versions_operations.py +++ /dev/null @@ -1,723 +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', "2022-10-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'), - "modelName": _SERIALIZER.url("model_name", model_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 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', "2022-10-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'), - "modelName": _SERIALIZER.url("model_name", model_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 - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - "modelName": _SERIALIZER.url("model_name", model_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 - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-10-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'), - "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 - ) - -# 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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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. - :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', "2022-10-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', "2022-10-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. - :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', "2022-10-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_schedules_operations.py deleted file mode 100644 index f86a36206fc2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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'), - "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', "2022-10-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', "2022-10-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', "2022-10-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, **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', "2022-10-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', "2022-10-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', "2022-10-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, **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/v2022_10_01_preview/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_usages_operations.py deleted file mode 100644 index eaf2673542b7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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', "2022-10-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/v2022_10_01_preview/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_virtual_machine_sizes_operations.py deleted file mode 100644 index 0c8ccb2106cb..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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', "2022-10-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/v2022_10_01_preview/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_connections_operations.py deleted file mode 100644 index 0e8b54fa156e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_connections_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 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_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', "2022-10-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'), - "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 = kwargs.pop('api_version', "2022-10-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'), - "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 = kwargs.pop('api_version', "2022-10-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'), - "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 - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - target = kwargs.pop('target', None) # type: Optional[str] - category = kwargs.pop('category', None) # type: Optional[str] - - 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'), - } - - _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', {})) - - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - 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, - 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 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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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 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. - - :param resource_group_name: The name of the resource group. 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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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 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 - """ - api_version = kwargs.pop('api_version', "2022-10-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, - 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, - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_features_operations.py deleted file mode 100644 index 95365dd5eca7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', "2022-10-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/v2022_10_01_preview/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspaces_operations.py deleted file mode 100644 index 86fa0ef46b74..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspaces_operations.py +++ /dev/null @@ -1,1832 +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_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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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 - api_version = kwargs.pop('api_version', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[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 = kwargs.pop('api_version', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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 - api_version = kwargs.pop('api_version', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[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 - api_version = kwargs.pop('api_version', "2022-10-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") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("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 - api_version = kwargs.pop('api_version', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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 - api_version = kwargs.pop('api_version', "2022-10-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/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 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 = kwargs.pop('api_version', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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 = kwargs.pop('api_version', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', "2022-10-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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 _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', {})) - - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - 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, - 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 - 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 - """ - api_version = kwargs.pop('api_version', "2022-10-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, - 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('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_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - def _delete_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', "2022-10-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, - 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) - - 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( # pylint: disable=inconsistent-return-statements - 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 - """ - api_version = kwargs.pop('api_version', "2022-10-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, - 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}"} # 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', {})) - - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - 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, - 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 - 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 - """ - api_version = kwargs.pop('api_version', "2022-10-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, - 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('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 - - @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 - """ - api_version = kwargs.pop('api_version', "2022-10-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, - 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, - 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("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 _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', {})) - - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - 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, - 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 - 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 - """ - api_version = kwargs.pop('api_version', "2022-10-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, - 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('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. - - :param resource_group_name: The name of the resource 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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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 - - - 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', "2022-10-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) - - 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( # 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. - - :param resource_group_name: The name of the resource 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 - """ - api_version = kwargs.pop('api_version', "2022-10-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, **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 - - @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 - """ - api_version = kwargs.pop('api_version', "2022-10-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, - 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, - 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("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_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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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 - - - 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', "2022-10-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 - 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 - """ - api_version = kwargs.pop('api_version', "2022-10-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 - - @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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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_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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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_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', {})) - - api_version = kwargs.pop('api_version', "2022-10-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/py.typed b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_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/_restclient/v2022_12_01_preview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/__init__.py deleted file mode 100644 index da46614477a9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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_12_01_preview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_azure_machine_learning_workspaces.py deleted file mode 100644 index 23c2eae6d090..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,241 +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, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, JobsOperations, LabelingJobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, 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 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 managed_network_settings_rule: ManagedNetworkSettingsRuleOperations operations - :vartype managed_network_settings_rule: - azure.mgmt.machinelearningservices.operations.ManagedNetworkSettingsRuleOperations - :ivar managed_network_provisions: ManagedNetworkProvisionsOperations operations - :vartype managed_network_provisions: - azure.mgmt.machinelearningservices.operations.ManagedNetworkProvisionsOperations - :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_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 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 labeling_jobs: LabelingJobsOperations operations - :vartype labeling_jobs: azure.mgmt.machinelearningservices.operations.LabelingJobsOperations - :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 - :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 "2022-12-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.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.managed_network_settings_rule = ManagedNetworkSettingsRuleOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_provisions = ManagedNetworkProvisionsOperations(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_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.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.labeling_jobs = LabelingJobsOperations(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) - - - 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_12_01_preview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_configuration.py deleted file mode 100644 index 00aa2745409c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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 "2022-12-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', "2022-12-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/v2022_12_01_preview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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_12_01_preview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_vendor.py deleted file mode 100644 index 138f663c53a4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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_12_01_preview/_version.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_version.py deleted file mode 100644 index eae7c95b6fbd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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_12_01_preview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/__init__.py deleted file mode 100644 index f67ccda966f1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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_12_01_preview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/_azure_machine_learning_workspaces.py deleted file mode 100644 index 1c0b79d06b95..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,238 +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, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, JobsOperations, LabelingJobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, 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 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 managed_network_settings_rule: ManagedNetworkSettingsRuleOperations operations - :vartype managed_network_settings_rule: - azure.mgmt.machinelearningservices.aio.operations.ManagedNetworkSettingsRuleOperations - :ivar managed_network_provisions: ManagedNetworkProvisionsOperations operations - :vartype managed_network_provisions: - azure.mgmt.machinelearningservices.aio.operations.ManagedNetworkProvisionsOperations - :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_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 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 labeling_jobs: LabelingJobsOperations operations - :vartype labeling_jobs: - azure.mgmt.machinelearningservices.aio.operations.LabelingJobsOperations - :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 - :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 "2022-12-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.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.managed_network_settings_rule = ManagedNetworkSettingsRuleOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_provisions = ManagedNetworkProvisionsOperations(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_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.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.labeling_jobs = LabelingJobsOperations(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) - - - 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_12_01_preview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/_configuration.py deleted file mode 100644 index 40a1d32cc86d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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 "2022-12-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', "2022-12-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/v2022_12_01_preview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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_12_01_preview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/__init__.py deleted file mode 100644 index 3591226dc04e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/__init__.py +++ /dev/null @@ -1,89 +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 ._managed_network_settings_rule_operations import ManagedNetworkSettingsRuleOperations -from ._managed_network_provisions_operations import ManagedNetworkProvisionsOperations -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_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 ._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 ._labeling_jobs_operations import LabelingJobsOperations -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 - -__all__ = [ - 'Operations', - 'WorkspacesOperations', - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'WorkspaceConnectionsOperations', - 'ManagedNetworkSettingsRuleOperations', - 'ManagedNetworkProvisionsOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'JobsOperations', - 'LabelingJobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_batch_deployments_operations.py deleted file mode 100644 index 01458590a5dc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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', "2022-12-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', "2022-12-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, **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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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, **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/v2022_12_01_preview/aio/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_batch_endpoints_operations.py deleted file mode 100644 index 8e810758ed64..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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', "2022-12-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', "2022-12-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, **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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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, **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', "2022-12-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/v2022_12_01_preview/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_code_containers_operations.py deleted file mode 100644 index a78ac69c15c1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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/v2022_12_01_preview/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_code_versions_operations.py deleted file mode 100644 index 5d60e3f9da58..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_code_versions_operations.py +++ /dev/null @@ -1,366 +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_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 - """ - api_version = kwargs.pop('api_version', "2022-12-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, - 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, - 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', "2022-12-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', "2022-12-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', "2022-12-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_component_containers_operations.py deleted file mode 100644 index 61b05c620aa0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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/v2022_12_01_preview/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_component_versions_operations.py deleted file mode 100644 index 7ae93db2ed41..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_component_versions_operations.py +++ /dev/null @@ -1,371 +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_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 - """ - api_version = kwargs.pop('api_version', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_compute_operations.py deleted file mode 100644 index a92d0de3be14..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_compute_operations.py +++ /dev/null @@ -1,1209 +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_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_custom_services_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: - """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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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 - - - 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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_data_containers_operations.py deleted file mode 100644 index 8ce2b9d5aec5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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/v2022_12_01_preview/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_data_versions_operations.py deleted file mode 100644 index e2bc7349b260..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_data_versions_operations.py +++ /dev/null @@ -1,380 +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_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 - """ - api_version = kwargs.pop('api_version', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_datastores_operations.py deleted file mode 100644 index b748d6debcd9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_datastores_operations.py +++ /dev/null @@ -1,438 +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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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, - **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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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, - name=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('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_12_01_preview/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_environment_containers_operations.py deleted file mode 100644 index fb8217f2a410..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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/v2022_12_01_preview/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_environment_versions_operations.py deleted file mode 100644 index 44ddf210bdcc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_environment_versions_operations.py +++ /dev/null @@ -1,371 +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_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 - """ - api_version = kwargs.pop('api_version', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_jobs_operations.py deleted file mode 100644 index 8b9d9a5d1dc9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,542 +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, - 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 - """ - api_version = kwargs.pop('api_version', "2022-12-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, - 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, - api_version=api_version, - 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( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=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', "2022-12-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', "2022-12-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, **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', "2022-12-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. - - 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.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', "2022-12-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', "2022-12-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', "2022-12-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/v2022_12_01_preview/aio/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_labeling_jobs_operations.py deleted file mode 100644 index 0f09de842342..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_labeling_jobs_operations.py +++ /dev/null @@ -1,739 +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._labeling_jobs_operations import build_create_or_update_request_initial, build_delete_request, build_export_labels_request_initial, build_get_request, build_list_request, build_pause_request, build_resume_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class LabelingJobsOperations: - """LabelingJobsOperations 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, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncIterable["_models.LabelingJobResourceArmPaginatedResult"]: - """Lists labeling jobs in the workspace. - - Lists labeling 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 top: Number of labeling jobs to return. - :type top: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LabelingJobResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 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, - top=top, - 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, - top=top, - 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("LabelingJobResourceArmPaginatedResult", 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}/labelingJobs"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - """Delete a labeling job. - - Delete a labeling 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 LabelingJob. - :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', {})) - - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - - - request = build_delete_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.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}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - id: str, - include_job_instructions: Optional[bool] = False, - include_label_categories: Optional[bool] = False, - **kwargs: Any - ) -> "_models.LabelingJob": - """Gets a labeling job by name/id. - - Gets a labeling 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 LabelingJob. - :type id: str - :param include_job_instructions: Boolean value to indicate whether to include JobInstructions - in response. - :type include_job_instructions: bool - :param include_label_categories: Boolean value to indicate Whether to include LabelCategories - in response. - :type include_label_categories: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LabelingJob, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJob - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2022-12-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, - include_job_instructions=include_job_instructions, - include_label_categories=include_label_categories, - 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('LabelingJob', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.LabelingJob", - **kwargs: Any - ) -> "_models.LabelingJob": - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'LabelingJob') - - request = build_create_or_update_request_initial( - 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_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('LabelingJob', 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('LabelingJob', 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}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.LabelingJob", - **kwargs: Any - ) -> AsyncLROPoller["_models.LabelingJob"]: - """Creates or updates a labeling job (asynchronous). - - Creates or updates a labeling 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 LabelingJob. - :type id: str - :param body: LabelingJob definition object. - :type body: ~azure.mgmt.machinelearningservices.models.LabelingJob - :keyword callable cls: A custom type or function that will be passed the direct response - :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 LabelingJob or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2022-12-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.LabelingJob"] - lro_delay = kwargs.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, - id=id, - 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('LabelingJob', 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}/labelingJobs/{id}"} # type: ignore - - async def _export_labels_initial( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.ExportSummary", - **kwargs: Any - ) -> Optional["_models.ExportSummary"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExportSummary"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ExportSummary') - - request = build_export_labels_request_initial( - 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._export_labels_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('ExportSummary', 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 - - _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - - @distributed_trace_async - async def begin_export_labels( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.ExportSummary", - **kwargs: Any - ) -> AsyncLROPoller["_models.ExportSummary"]: - """Export labels from a labeling job (asynchronous). - - Export labels from a labeling 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 LabelingJob. - :type id: str - :param body: The export summary. - :type body: ~azure.mgmt.machinelearningservices.models.ExportSummary - :keyword callable cls: A custom type or function that will be passed the direct response - :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 ExportSummary or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2022-12-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.ExportSummary"] - lro_delay = kwargs.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._export_labels_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - 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('ExportSummary', 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_export_labels.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - @distributed_trace_async - async def pause( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - """Pause a labeling job. - - Pause a labeling 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 LabelingJob. - :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', {})) - - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - - - request = build_pause_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.pause.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, 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, {}) - - pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - - - async def _resume_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', "2022-12-01-preview") # type: str - - - request = build_resume_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._resume_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) - - _resume_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore - - - @distributed_trace_async - async def begin_resume( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Resume a labeling job (asynchronous). - - Resume a labeling 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 LabelingJob. - :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', "2022-12-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._resume_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_resume.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_managed_network_provisions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_managed_network_provisions_operations.py deleted file mode 100644 index f9483b70e6ea..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_managed_network_provisions_operations.py +++ /dev/null @@ -1,180 +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, - parameters: 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', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if parameters is not None: - _json = self._serialize.body(parameters, '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')) - - - 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, - parameters: Optional["_models.ManagedNetworkProvisionOptions"] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.ManagedNetworkProvisionStatus"]: - """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: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param parameters: Managed Network Provisioning Options for a machine learning workspace. - :type parameters: ~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', "2022-12-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, - 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('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/v2022_12_01_preview/aio/operations/_managed_network_settings_rule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_managed_network_settings_rule_operations.py deleted file mode 100644 index fb594b8defc3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_managed_network_settings_rule_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, 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. - - :param resource_group_name: The name of the resource 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 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', "2022-12-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', "2022-12-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')) - - - 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. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :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', "2022-12-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. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :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', "2022-12-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, - parameters: "_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', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, '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')) - - - 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, - parameters: "_models.OutboundRuleBasicResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.OutboundRuleBasicResource"]: - """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: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :param parameters: Outbound Rule to be created or updated in the managed network of a machine - learning workspace. - :type parameters: ~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', "2022-12-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, - 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('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/v2022_12_01_preview/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_model_containers_operations.py deleted file mode 100644 index d4c1e0cb17e2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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/v2022_12_01_preview/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_model_versions_operations.py deleted file mode 100644 index 4a7898244189..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_model_versions_operations.py +++ /dev/null @@ -1,403 +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_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 - """ - api_version = kwargs.pop('api_version', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_online_deployments_operations.py deleted file mode 100644 index 5d0ca6856f39..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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', "2022-12-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', "2022-12-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, **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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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, **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', "2022-12-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', "2022-12-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/v2022_12_01_preview/aio/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_online_endpoints_operations.py deleted file mode 100644 index f76ab2fc118a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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', "2022-12-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', "2022-12-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, **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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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, **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', "2022-12-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', "2022-12-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', "2022-12-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 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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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/v2022_12_01_preview/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_operations.py deleted file mode 100644 index e7b501d80ebf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_operations.py +++ /dev/null @@ -1,117 +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.AmlOperationListResult"]: - """Lists all of the available Azure Machine Learning Services 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 AmlOperationListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlOperationListResult"] - error_map = { - 401: ClientAuthenticationError, 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("AmlOperationListResult", 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/v2022_12_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index 140eb346b298..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,325 +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"]: - """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 - """ - api_version = kwargs.pop('api_version', "2022-12-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( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - 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) - - else: - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - 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("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 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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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, - 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', {})) - - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - 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, - 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 - - - @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: - """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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_private_link_resources_operations.py deleted file mode 100644 index e9aa33d0ab82..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,103 +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._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', {})) - - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - - - 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) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, 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_12_01_preview/aio/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_quotas_operations.py deleted file mode 100644 index 7811773f8070..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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', "2022-12-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/v2022_12_01_preview/aio/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registries_operations.py deleted file mode 100644 index 62e971e40497..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registries_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._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_update_request_initial -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, - skip: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: - """List registries by subscription. - - List registries by 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 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', "2022-12-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, - 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, - 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("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, - skip: Optional[str] = None, - **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 - :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 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', "2022-12-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, - 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, - 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("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', "2022-12-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 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', "2022-12-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 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', "2022-12-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 - - - async def _update_initial( - self, - resource_group_name: str, - registry_name: str, - body: "_models.PartialRegistryPartialTrackedResource", - **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', "2022-12-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_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._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Registry', 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')) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - registry_name: str, - body: "_models.PartialRegistryPartialTrackedResource", - **kwargs: Any - ) -> AsyncLROPoller["_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 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 - :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', "2022-12-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._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': '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_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 - ) -> 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', "2022-12-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, 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('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 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', "2022-12-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_code_containers_operations.py deleted file mode 100644 index 60757f27121e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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. - :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', "2022-12-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', "2022-12-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 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. - :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', "2022-12-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 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. - :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', "2022-12-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', "2022-12-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 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. - :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', "2022-12-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/v2022_12_01_preview/aio/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_code_versions_operations.py deleted file mode 100644 index c86e581bcfe5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_code_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_code_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 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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_component_containers_operations.py deleted file mode 100644 index 380b70d8111d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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/v2022_12_01_preview/aio/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_component_versions_operations.py deleted file mode 100644 index 0613f1e020ad..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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/v2022_12_01_preview/aio/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_environment_containers_operations.py deleted file mode 100644 index e49f0ac53412..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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/v2022_12_01_preview/aio/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_environment_versions_operations.py deleted file mode 100644 index 2fcaf965053d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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/v2022_12_01_preview/aio/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_model_containers_operations.py deleted file mode 100644 index 55c0e5bf8ecf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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/v2022_12_01_preview/aio/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_model_versions_operations.py deleted file mode 100644 index e1cf2a4e6fb4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_model_versions_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 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_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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_schedules_operations.py deleted file mode 100644 index 8c310ccc07d6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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', "2022-12-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', "2022-12-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, **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', "2022-12-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', "2022-12-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', "2022-12-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, **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/v2022_12_01_preview/aio/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_usages_operations.py deleted file mode 100644 index cde3e1a0bfb8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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/v2022_12_01_preview/aio/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_virtual_machine_sizes_operations.py deleted file mode 100644 index 4f13114c1c90..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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/v2022_12_01_preview/aio/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_workspace_connections_operations.py deleted file mode 100644 index cfac1c97d0b2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_workspace_connections_operations.py +++ /dev/null @@ -1,333 +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._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', {})) - - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - 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, - 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 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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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 delete( # pylint: disable=inconsistent-return-statements - 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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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 - 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 - """ - api_version = kwargs.pop('api_version', "2022-12-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, - 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, - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_workspace_features_operations.py deleted file mode 100644 index d85900d038e7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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/v2022_12_01_preview/aio/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_workspaces_operations.py deleted file mode 100644 index a9d712237ab1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_workspaces_operations.py +++ /dev/null @@ -1,1281 +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_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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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 _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', {})) - - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - 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, - 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 - 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 - """ - api_version = kwargs.pop('api_version', "2022-12-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, - 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('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_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - async def _delete_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', "2022-12-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, - 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) - - 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( # pylint: disable=inconsistent-return-statements - 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 - """ - api_version = kwargs.pop('api_version', "2022-12-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, - 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}"} # 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', {})) - - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - 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, - 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, - 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 - """ - api_version = kwargs.pop('api_version', "2022-12-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, - 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('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 - - @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 - """ - api_version = kwargs.pop('api_version', "2022-12-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, - 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, - 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("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 _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', {})) - - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - 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, - 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, - 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 - """ - api_version = kwargs.pop('api_version', "2022-12-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, - 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('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. - - :param resource_group_name: The name of the resource 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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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 - - - 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', "2022-12-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) - - 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( # 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. - - :param resource_group_name: The name of the resource 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 - """ - api_version = kwargs.pop('api_version', "2022-12-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, **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 - - @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 - """ - api_version = kwargs.pop('api_version', "2022-12-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, - 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, - 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("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_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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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 - - - 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', "2022-12-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 - 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 - """ - api_version = kwargs.pop('api_version', "2022-12-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 - - @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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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_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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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_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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/__init__.py deleted file mode 100644 index 92a40e8bdd88..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/__init__.py +++ /dev/null @@ -1,1627 +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 AKSSchema - from ._models_py3 import AKSSchemaProperties - from ._models_py3 import AccessKeyAuthTypeWorkspaceConnectionProperties - 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 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 AmlOperation - from ._models_py3 import AmlOperationDisplay - from ._models_py3 import AmlOperationListResult - from ._models_py3 import AmlToken - from ._models_py3 import AmlUserFeature - 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 AutologgerSettings - from ._models_py3 import AzureBlobDatastore - from ._models_py3 import AzureDataLakeGen1Datastore - from ._models_py3 import AzureDataLakeGen2Datastore - from ._models_py3 import AzureDatastore - from ._models_py3 import AzureFileDatastore - from ._models_py3 import BanditPolicy - from ._models_py3 import BatchDeployment - 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 BatchRetrySettings - from ._models_py3 import BayesianSamplingAlgorithm - from ._models_py3 import BindOptions - from ._models_py3 import BuildContext - 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 CocoExportSummary - 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 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 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 CosmosDbSettings - from ._models_py3 import CronTrigger - from ._models_py3 import CsvExportSummary - 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 CustomService - from ._models_py3 import CustomTargetLags - from ._models_py3 import CustomTargetRollingWindowSize - from ._models_py3 import DataContainer - from ._models_py3 import DataContainerProperties - from ._models_py3 import DataContainerResourceArmPaginatedResult - 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 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 DatasetExportSummary - 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 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 EarlyTerminationPolicy - from ._models_py3 import EncryptionKeyVaultProperties - 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 EndpointDeploymentPropertiesBase - from ._models_py3 import EndpointPropertiesBase - 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 ExportSummary - 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 FeatureStoreSettings - 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 ForecastingTrainingSettings - from ._models_py3 import FqdnOutboundRule - from ._models_py3 import GridSamplingAlgorithm - from ._models_py3 import HDInsight - from ._models_py3 import HDInsightProperties - from ._models_py3 import HDInsightSchema - from ._models_py3 import HdfsDatastore - 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 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 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 Kubernetes - from ._models_py3 import KubernetesOnlineDeployment - from ._models_py3 import KubernetesProperties - from ._models_py3 import KubernetesSchema - from ._models_py3 import LabelCategory - from ._models_py3 import LabelClass - from ._models_py3 import LabelingDataConfiguration - from ._models_py3 import LabelingJob - from ._models_py3 import LabelingJobImageProperties - from ._models_py3 import LabelingJobInstructions - from ._models_py3 import LabelingJobMediaProperties - from ._models_py3 import LabelingJobProperties - from ._models_py3 import LabelingJobResourceArmPaginatedResult - from ._models_py3 import LabelingJobTextProperties - 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 MLAssistConfiguration - from ._models_py3 import MLAssistConfigurationDisabled - from ._models_py3 import MLAssistConfigurationEnabled - 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 ManagedIdentityAuthTypeWorkspaceConnectionProperties - from ._models_py3 import ManagedNetworkProvisionOptions - from ._models_py3 import ManagedNetworkProvisionStatus - from ._models_py3 import ManagedNetworkSettings - from ._models_py3 import ManagedOnlineDeployment - from ._models_py3 import ManagedServiceIdentity - from ._models_py3 import MedianStoppingPolicy - from ._models_py3 import ModelContainer - from ._models_py3 import ModelContainerProperties - from ._models_py3 import ModelContainerResourceArmPaginatedResult - from ._models_py3 import ModelVersion - from ._models_py3 import ModelVersionProperties - from ._models_py3 import ModelVersionResourceArmPaginatedResult - from ._models_py3 import Mpi - from ._models_py3 import NCrossValidations - from ._models_py3 import NlpFixedParameters - from ._models_py3 import NlpParameterSubspace - from ._models_py3 import NlpSweepSettings - 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 Objective - 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 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 PartialRegistryPartialTrackedResource - from ._models_py3 import PartialSku - from ._models_py3 import Password - from ._models_py3 import PersonalComputeInstanceSettings - from ._models_py3 import PipelineJob - 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 PrivateLinkResource - from ._models_py3 import PrivateLinkResourceListResult - from ._models_py3 import PrivateLinkServiceConnectionState - from ._models_py3 import ProbeSettings - from ._models_py3 import ProgressMetrics - from ._models_py3 import PyTorch - from ._models_py3 import QuotaBaseProperties - from ._models_py3 import QuotaUpdateParameters - from ._models_py3 import RandomSamplingAlgorithm - from ._models_py3 import RecurrenceSchedule - from ._models_py3 import RecurrenceTrigger - from ._models_py3 import RegenerateEndpointKeysRequest - from ._models_py3 import Registry - from ._models_py3 import RegistryListCredentialsResult - from ._models_py3 import RegistryProperties - from ._models_py3 import RegistryRegionArmDetails - from ._models_py3 import RegistryTrackedResourceArmPaginatedResult - from ._models_py3 import Regression - from ._models_py3 import RegressionTrainingSettings - 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 Route - from ._models_py3 import SASAuthTypeWorkspaceConnectionProperties - 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 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 SslConfiguration - from ._models_py3 import StackEnsembleSettings - from ._models_py3 import StatusMessage - 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 TableFixedParameters - from ._models_py3 import TableParameterSubspace - from ._models_py3 import TableSweepSettings - 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 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 Workspace - from ._models_py3 import WorkspaceConnectionAccessKey - from ._models_py3 import WorkspaceConnectionManagedIdentity - 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 WorkspaceConnectionUsernamePassword - from ._models_py3 import WorkspaceListResult - from ._models_py3 import WorkspaceUpdateParameters -except (SyntaxError, ImportError): - 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 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 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 AmlOperation # type: ignore - from ._models import AmlOperationDisplay # type: ignore - from ._models import AmlOperationListResult # type: ignore - from ._models import AmlToken # type: ignore - from ._models import AmlUserFeature # 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 AutologgerSettings # 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 AzureFileDatastore # type: ignore - from ._models import BanditPolicy # type: ignore - from ._models import BatchDeployment # 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 BatchRetrySettings # type: ignore - from ._models import BayesianSamplingAlgorithm # type: ignore - from ._models import BindOptions # 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 ClassificationTrainingSettings # type: ignore - from ._models import ClusterUpdateParameters # type: ignore - from ._models import CocoExportSummary # 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 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 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 CosmosDbSettings # type: ignore - from ._models import CronTrigger # type: ignore - from ._models import CsvExportSummary # 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 CustomService # type: ignore - from ._models import CustomTargetLags # type: ignore - from ._models import CustomTargetRollingWindowSize # type: ignore - from ._models import DataContainer # type: ignore - from ._models import DataContainerProperties # type: ignore - from ._models import DataContainerResourceArmPaginatedResult # 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 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 DatasetExportSummary # 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 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 EarlyTerminationPolicy # type: ignore - from ._models import EncryptionKeyVaultProperties # 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 EndpointDeploymentPropertiesBase # type: ignore - from ._models import EndpointPropertiesBase # 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 ExportSummary # 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 FeatureStoreSettings # 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 ForecastingTrainingSettings # type: ignore - from ._models import FqdnOutboundRule # 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 HdfsDatastore # 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 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 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 Kubernetes # type: ignore - from ._models import KubernetesOnlineDeployment # type: ignore - from ._models import KubernetesProperties # type: ignore - from ._models import KubernetesSchema # type: ignore - from ._models import LabelCategory # type: ignore - from ._models import LabelClass # type: ignore - from ._models import LabelingDataConfiguration # type: ignore - from ._models import LabelingJob # type: ignore - from ._models import LabelingJobImageProperties # type: ignore - from ._models import LabelingJobInstructions # type: ignore - from ._models import LabelingJobMediaProperties # type: ignore - from ._models import LabelingJobProperties # type: ignore - from ._models import LabelingJobResourceArmPaginatedResult # type: ignore - from ._models import LabelingJobTextProperties # 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 MLAssistConfiguration # type: ignore - from ._models import MLAssistConfigurationDisabled # type: ignore - from ._models import MLAssistConfigurationEnabled # 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 ManagedIdentityAuthTypeWorkspaceConnectionProperties # 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 ManagedServiceIdentity # 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 ModelVersion # type: ignore - from ._models import ModelVersionProperties # type: ignore - from ._models import ModelVersionResourceArmPaginatedResult # type: ignore - from ._models import Mpi # type: ignore - from ._models import NCrossValidations # type: ignore - from ._models import NlpFixedParameters # type: ignore - from ._models import NlpParameterSubspace # type: ignore - from ._models import NlpSweepSettings # 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 Objective # 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 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 PartialRegistryPartialTrackedResource # type: ignore - from ._models import PartialSku # type: ignore - from ._models import Password # type: ignore - from ._models import PersonalComputeInstanceSettings # type: ignore - from ._models import PipelineJob # 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 PrivateLinkResource # type: ignore - from ._models import PrivateLinkResourceListResult # type: ignore - from ._models import PrivateLinkServiceConnectionState # type: ignore - from ._models import ProbeSettings # type: ignore - from ._models import ProgressMetrics # type: ignore - from ._models import PyTorch # type: ignore - from ._models import QuotaBaseProperties # type: ignore - from ._models import QuotaUpdateParameters # type: ignore - from ._models import RandomSamplingAlgorithm # type: ignore - from ._models import RecurrenceSchedule # type: ignore - from ._models import RecurrenceTrigger # type: ignore - from ._models import RegenerateEndpointKeysRequest # type: ignore - from ._models import Registry # type: ignore - from ._models import RegistryListCredentialsResult # type: ignore - from ._models import RegistryProperties # 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 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 Route # type: ignore - from ._models import SASAuthTypeWorkspaceConnectionProperties # 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 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 SslConfiguration # type: ignore - from ._models import StackEnsembleSettings # type: ignore - from ._models import StatusMessage # 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 TableFixedParameters # type: ignore - from ._models import TableParameterSubspace # type: ignore - from ._models import TableSweepSettings # 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 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 Workspace # type: ignore - from ._models import WorkspaceConnectionAccessKey # type: ignore - from ._models import WorkspaceConnectionManagedIdentity # 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 WorkspaceConnectionUsernamePassword # type: ignore - from ._models import WorkspaceListResult # type: ignore - from ._models import WorkspaceUpdateParameters # type: ignore - -from ._azure_machine_learning_workspaces_enums import ( - AllocationState, - ApplicationSharingPolicy, - AssetProvisioningState, - AutoRebuildSetting, - Autosave, - BatchLoggingLevel, - BatchOutputAction, - BillingCurrency, - BlockedTransformers, - Caching, - ClassificationModels, - ClassificationMultilabelPrimaryMetrics, - ClassificationPrimaryMetrics, - ClusterPurpose, - ComputeInstanceAuthorizationType, - ComputeInstanceState, - ComputePowerAction, - ComputeType, - ConnectionAuthType, - ConnectionCategory, - ContainerType, - CreatedByType, - CredentialsType, - DataType, - DatastoreType, - DeploymentProvisioningState, - DiagnoseResultLevel, - DistributionType, - EarlyTerminationPolicyType, - EgressPublicNetworkAccessType, - EncryptionStatus, - EndpointAuthMode, - EndpointComputeType, - EndpointProvisioningState, - EnvironmentType, - EnvironmentVariableType, - ExportFormatType, - FeatureLags, - FeaturizationMode, - ForecastHorizonMode, - ForecastingModels, - ForecastingPrimaryMetrics, - Goal, - IdentityConfigurationType, - ImageAnnotationType, - ImageType, - IncrementalDataRefresh, - InputDeliveryMode, - InstanceSegmentationPrimaryMetrics, - IsolationMode, - JobInputType, - JobLimitsType, - JobOutputType, - JobProvisioningState, - JobStatus, - JobType, - KeyType, - LearningRateScheduler, - ListViewType, - LoadBalancerType, - LogVerbosity, - MLAssistConfigurationType, - MLFlowAutologgerState, - ManagedNetworkStatus, - ManagedServiceIdentityType, - MediaType, - MlflowAutologger, - ModelSize, - MountAction, - MountState, - MultiSelect, - NCrossValidationsMode, - Network, - NlpLearningRateScheduler, - NodeState, - NodesValueType, - ObjectDetectionPrimaryMetrics, - OperatingSystemType, - OperationName, - OperationStatus, - OperationTrigger, - OrderString, - OsType, - OutputDeliveryMode, - PrivateEndpointConnectionProvisioningState, - PrivateEndpointServiceConnectionStatus, - Protocol, - ProvisioningState, - ProvisioningStatus, - PublicNetworkAccess, - PublicNetworkAccessType, - QuotaUnit, - RandomSamplingAlgorithmRule, - RecurrenceFrequency, - ReferenceType, - RegressionModels, - RegressionPrimaryMetrics, - RemoteLoginPortPublicAccess, - RuleCategory, - RuleStatus, - RuleType, - SamplingAlgorithmType, - ScaleType, - ScheduleActionType, - ScheduleListViewType, - ScheduleProvisioningState, - ScheduleProvisioningStatus, - ScheduleStatus, - SeasonalityMode, - SecretsType, - ServiceDataAccessAuthIdentity, - ShortSeriesHandlingConfiguration, - SkuScaleType, - SkuTier, - SourceType, - SparkJobEntryType, - SshPublicAccess, - SslConfigStatus, - StackMetaLearnerType, - Status, - StatusMessageLevel, - StochasticOptimizer, - StorageAccountType, - TargetAggregationFunction, - TargetLagsMode, - TargetRollingWindowSizeMode, - TaskType, - TextAnnotationType, - TrainingMode, - TriggerType, - UnderlyingResourceAction, - UnitOfMeasure, - UsageUnit, - UseStl, - VMPriceOSType, - VMTier, - ValidationMetricType, - ValueFormat, - VmPriority, - VolumeDefinitionType, - WeekDay, -) - -__all__ = [ - 'AKS', - 'AKSSchema', - 'AKSSchemaProperties', - 'AccessKeyAuthTypeWorkspaceConnectionProperties', - 'AccountKeyDatastoreCredentials', - 'AccountKeyDatastoreSecrets', - 'AcrDetails', - 'AksComputeSecrets', - 'AksComputeSecretsProperties', - 'AksNetworkingConfiguration', - 'AllNodes', - 'AmlCompute', - 'AmlComputeNodeInformation', - 'AmlComputeNodesInformation', - 'AmlComputeProperties', - 'AmlComputeSchema', - 'AmlOperation', - 'AmlOperationDisplay', - 'AmlOperationListResult', - 'AmlToken', - 'AmlUserFeature', - 'ArmResourceId', - 'AssetBase', - 'AssetContainer', - 'AssetJobInput', - 'AssetJobOutput', - 'AssetReferenceBase', - 'AssignedUser', - 'AutoForecastHorizon', - 'AutoMLJob', - 'AutoMLVertical', - 'AutoNCrossValidations', - 'AutoPauseProperties', - 'AutoScaleProperties', - 'AutoSeasonality', - 'AutoTargetLags', - 'AutoTargetRollingWindowSize', - 'AutologgerSettings', - 'AzureBlobDatastore', - 'AzureDataLakeGen1Datastore', - 'AzureDataLakeGen2Datastore', - 'AzureDatastore', - 'AzureFileDatastore', - 'BanditPolicy', - 'BatchDeployment', - 'BatchDeploymentProperties', - 'BatchDeploymentTrackedResourceArmPaginatedResult', - 'BatchEndpoint', - 'BatchEndpointDefaults', - 'BatchEndpointProperties', - 'BatchEndpointTrackedResourceArmPaginatedResult', - 'BatchRetrySettings', - 'BayesianSamplingAlgorithm', - 'BindOptions', - 'BuildContext', - 'CertificateDatastoreCredentials', - 'CertificateDatastoreSecrets', - 'Classification', - 'ClassificationTrainingSettings', - 'ClusterUpdateParameters', - 'CocoExportSummary', - 'CodeConfiguration', - 'CodeContainer', - 'CodeContainerProperties', - 'CodeContainerResourceArmPaginatedResult', - 'CodeVersion', - 'CodeVersionProperties', - 'CodeVersionResourceArmPaginatedResult', - 'ColumnTransformer', - 'CommandJob', - 'CommandJobLimits', - 'ComponentContainer', - 'ComponentContainerProperties', - 'ComponentContainerResourceArmPaginatedResult', - 'ComponentVersion', - 'ComponentVersionProperties', - 'ComponentVersionResourceArmPaginatedResult', - 'Compute', - 'ComputeInstance', - 'ComputeInstanceApplication', - 'ComputeInstanceAutologgerSettings', - 'ComputeInstanceConnectivityEndpoints', - 'ComputeInstanceContainer', - 'ComputeInstanceCreatedBy', - 'ComputeInstanceDataDisk', - 'ComputeInstanceDataMount', - 'ComputeInstanceEnvironmentInfo', - 'ComputeInstanceLastOperation', - 'ComputeInstanceProperties', - 'ComputeInstanceSchema', - 'ComputeInstanceSshSettings', - 'ComputeInstanceVersion', - 'ComputeResource', - 'ComputeResourceSchema', - 'ComputeRuntimeDto', - 'ComputeSchedules', - 'ComputeSecrets', - 'ComputeStartStopSchedule', - 'ContainerResourceRequirements', - 'ContainerResourceSettings', - 'CosmosDbSettings', - 'CronTrigger', - 'CsvExportSummary', - 'CustomForecastHorizon', - 'CustomModelJobInput', - 'CustomModelJobOutput', - 'CustomNCrossValidations', - 'CustomSeasonality', - 'CustomService', - 'CustomTargetLags', - 'CustomTargetRollingWindowSize', - 'DataContainer', - 'DataContainerProperties', - 'DataContainerResourceArmPaginatedResult', - 'DataFactory', - 'DataLakeAnalytics', - 'DataLakeAnalyticsSchema', - 'DataLakeAnalyticsSchemaProperties', - 'DataPathAssetReference', - 'DataVersionBase', - 'DataVersionBaseProperties', - 'DataVersionBaseResourceArmPaginatedResult', - 'Databricks', - 'DatabricksComputeSecrets', - 'DatabricksComputeSecretsProperties', - 'DatabricksProperties', - 'DatabricksSchema', - 'DatasetExportSummary', - 'Datastore', - 'DatastoreCredentials', - 'DatastoreProperties', - 'DatastoreResourceArmPaginatedResult', - 'DatastoreSecrets', - 'DefaultScaleSettings', - 'DeploymentLogs', - 'DeploymentLogsRequest', - 'DeploymentResourceConfiguration', - 'DiagnoseRequestProperties', - 'DiagnoseResponseResult', - 'DiagnoseResponseResultValue', - 'DiagnoseResult', - 'DiagnoseWorkspaceParameters', - 'DistributionConfiguration', - 'Docker', - 'EarlyTerminationPolicy', - 'EncryptionKeyVaultProperties', - 'EncryptionKeyVaultUpdateProperties', - 'EncryptionProperty', - 'EncryptionUpdateProperties', - 'Endpoint', - 'EndpointAuthKeys', - 'EndpointAuthToken', - 'EndpointDeploymentPropertiesBase', - 'EndpointPropertiesBase', - 'EndpointScheduleAction', - 'EnvironmentContainer', - 'EnvironmentContainerProperties', - 'EnvironmentContainerResourceArmPaginatedResult', - 'EnvironmentVariable', - 'EnvironmentVersion', - 'EnvironmentVersionProperties', - 'EnvironmentVersionResourceArmPaginatedResult', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'EstimatedVMPrice', - 'EstimatedVMPrices', - 'ExportSummary', - 'ExternalFQDNResponse', - 'FQDNEndpoint', - 'FQDNEndpointDetail', - 'FQDNEndpoints', - 'FQDNEndpointsProperties', - 'FeatureStoreSettings', - 'FeaturizationSettings', - 'FlavorData', - 'ForecastHorizon', - 'Forecasting', - 'ForecastingSettings', - 'ForecastingTrainingSettings', - 'FqdnOutboundRule', - 'GridSamplingAlgorithm', - 'HDInsight', - 'HDInsightProperties', - 'HDInsightSchema', - 'HdfsDatastore', - 'IdAssetReference', - 'IdentityConfiguration', - 'IdentityForCmk', - 'IdleShutdownSetting', - 'Image', - 'ImageClassification', - 'ImageClassificationBase', - 'ImageClassificationMultilabel', - 'ImageInstanceSegmentation', - 'ImageLimitSettings', - 'ImageMetadata', - 'ImageModelDistributionSettings', - 'ImageModelDistributionSettingsClassification', - 'ImageModelDistributionSettingsObjectDetection', - 'ImageModelSettings', - 'ImageModelSettingsClassification', - 'ImageModelSettingsObjectDetection', - 'ImageObjectDetection', - 'ImageObjectDetectionBase', - 'ImageSweepSettings', - 'ImageVertical', - 'InferenceContainerProperties', - 'InstanceTypeSchema', - 'InstanceTypeSchemaResources', - 'JobBase', - 'JobBaseProperties', - 'JobBaseResourceArmPaginatedResult', - 'JobInput', - 'JobLimits', - 'JobOutput', - 'JobResourceConfiguration', - 'JobScheduleAction', - 'JobService', - 'KerberosCredentials', - 'KerberosKeytabCredentials', - 'KerberosKeytabSecrets', - 'KerberosPasswordCredentials', - 'KerberosPasswordSecrets', - 'Kubernetes', - 'KubernetesOnlineDeployment', - 'KubernetesProperties', - 'KubernetesSchema', - 'LabelCategory', - 'LabelClass', - 'LabelingDataConfiguration', - 'LabelingJob', - 'LabelingJobImageProperties', - 'LabelingJobInstructions', - 'LabelingJobMediaProperties', - 'LabelingJobProperties', - 'LabelingJobResourceArmPaginatedResult', - 'LabelingJobTextProperties', - 'ListAmlUserFeatureResult', - 'ListNotebookKeysResult', - 'ListStorageAccountKeysResult', - 'ListUsagesResult', - 'ListWorkspaceKeysResult', - 'ListWorkspaceQuotas', - 'LiteralJobInput', - 'MLAssistConfiguration', - 'MLAssistConfigurationDisabled', - 'MLAssistConfigurationEnabled', - 'MLFlowModelJobInput', - 'MLFlowModelJobOutput', - 'MLTableData', - 'MLTableJobInput', - 'MLTableJobOutput', - 'ManagedIdentity', - 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', - 'ManagedNetworkProvisionOptions', - 'ManagedNetworkProvisionStatus', - 'ManagedNetworkSettings', - 'ManagedOnlineDeployment', - 'ManagedServiceIdentity', - 'MedianStoppingPolicy', - 'ModelContainer', - 'ModelContainerProperties', - 'ModelContainerResourceArmPaginatedResult', - 'ModelVersion', - 'ModelVersionProperties', - 'ModelVersionResourceArmPaginatedResult', - 'Mpi', - 'NCrossValidations', - 'NlpFixedParameters', - 'NlpParameterSubspace', - 'NlpSweepSettings', - 'NlpVertical', - 'NlpVerticalFeaturizationSettings', - 'NlpVerticalLimitSettings', - 'NodeStateCounts', - 'Nodes', - 'NoneAuthTypeWorkspaceConnectionProperties', - 'NoneDatastoreCredentials', - 'NotebookAccessTokenResult', - 'NotebookPreparationError', - 'NotebookResourceInfo', - 'Objective', - 'OnlineDeployment', - 'OnlineDeploymentProperties', - 'OnlineDeploymentTrackedResourceArmPaginatedResult', - 'OnlineEndpoint', - 'OnlineEndpointProperties', - 'OnlineEndpointTrackedResourceArmPaginatedResult', - 'OnlineRequestSettings', - 'OnlineScaleSettings', - 'OutboundRule', - 'OutboundRuleBasicResource', - 'OutboundRuleListResult', - 'OutputPathAssetReference', - 'PATAuthTypeWorkspaceConnectionProperties', - 'PaginatedComputeResourcesList', - 'PartialBatchDeployment', - 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties', - 'PartialManagedServiceIdentity', - 'PartialMinimalTrackedResource', - 'PartialMinimalTrackedResourceWithIdentity', - 'PartialMinimalTrackedResourceWithSku', - 'PartialRegistryPartialTrackedResource', - 'PartialSku', - 'Password', - 'PersonalComputeInstanceSettings', - 'PipelineJob', - 'PrivateEndpoint', - 'PrivateEndpointConnection', - 'PrivateEndpointConnectionListResult', - 'PrivateEndpointDestination', - 'PrivateEndpointOutboundRule', - 'PrivateLinkResource', - 'PrivateLinkResourceListResult', - 'PrivateLinkServiceConnectionState', - 'ProbeSettings', - 'ProgressMetrics', - 'PyTorch', - 'QuotaBaseProperties', - 'QuotaUpdateParameters', - 'RandomSamplingAlgorithm', - 'RecurrenceSchedule', - 'RecurrenceTrigger', - 'RegenerateEndpointKeysRequest', - 'Registry', - 'RegistryListCredentialsResult', - 'RegistryProperties', - 'RegistryRegionArmDetails', - 'RegistryTrackedResourceArmPaginatedResult', - 'Regression', - 'RegressionTrainingSettings', - 'Resource', - 'ResourceBase', - 'ResourceConfiguration', - 'ResourceId', - 'ResourceName', - 'ResourceQuota', - 'Route', - 'SASAuthTypeWorkspaceConnectionProperties', - 'SamplingAlgorithm', - 'SasDatastoreCredentials', - 'SasDatastoreSecrets', - 'ScaleSettings', - 'ScaleSettingsInformation', - 'Schedule', - 'ScheduleActionBase', - 'ScheduleBase', - 'ScheduleProperties', - 'ScheduleResourceArmPaginatedResult', - 'ScriptReference', - 'ScriptsToExecute', - 'Seasonality', - 'ServiceManagedResourcesSettings', - 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', - 'ServicePrincipalDatastoreCredentials', - 'ServicePrincipalDatastoreSecrets', - 'ServiceTagDestination', - 'ServiceTagOutboundRule', - 'SetupScripts', - 'SharedPrivateLinkResource', - 'Sku', - 'SkuCapacity', - 'SkuResource', - 'SkuResourceArmPaginatedResult', - 'SkuSetting', - 'SparkJob', - 'SparkJobEntry', - 'SparkJobPythonEntry', - 'SparkJobScalaEntry', - 'SparkResourceConfiguration', - 'SslConfiguration', - 'StackEnsembleSettings', - 'StatusMessage', - 'StorageAccountDetails', - 'SweepJob', - 'SweepJobLimits', - 'SynapseSpark', - 'SynapseSparkProperties', - 'SystemCreatedAcrAccount', - 'SystemCreatedStorageAccount', - 'SystemData', - 'SystemService', - 'TableFixedParameters', - 'TableParameterSubspace', - 'TableSweepSettings', - 'TableVertical', - 'TableVerticalFeaturizationSettings', - 'TableVerticalLimitSettings', - 'TargetLags', - 'TargetRollingWindowSize', - 'TargetUtilizationScaleSettings', - 'TensorFlow', - 'TextClassification', - 'TextClassificationMultilabel', - 'TextNer', - 'TmpfsOptions', - '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', - 'Workspace', - 'WorkspaceConnectionAccessKey', - 'WorkspaceConnectionManagedIdentity', - 'WorkspaceConnectionPersonalAccessToken', - 'WorkspaceConnectionPropertiesV2', - 'WorkspaceConnectionPropertiesV2BasicResource', - 'WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult', - 'WorkspaceConnectionServicePrincipal', - 'WorkspaceConnectionSharedAccessSignature', - 'WorkspaceConnectionUsernamePassword', - 'WorkspaceListResult', - 'WorkspaceUpdateParameters', - 'AllocationState', - 'ApplicationSharingPolicy', - 'AssetProvisioningState', - 'AutoRebuildSetting', - 'Autosave', - 'BatchLoggingLevel', - 'BatchOutputAction', - 'BillingCurrency', - 'BlockedTransformers', - 'Caching', - 'ClassificationModels', - 'ClassificationMultilabelPrimaryMetrics', - 'ClassificationPrimaryMetrics', - 'ClusterPurpose', - 'ComputeInstanceAuthorizationType', - 'ComputeInstanceState', - 'ComputePowerAction', - 'ComputeType', - 'ConnectionAuthType', - 'ConnectionCategory', - 'ContainerType', - 'CreatedByType', - 'CredentialsType', - 'DataType', - 'DatastoreType', - 'DeploymentProvisioningState', - 'DiagnoseResultLevel', - 'DistributionType', - 'EarlyTerminationPolicyType', - 'EgressPublicNetworkAccessType', - 'EncryptionStatus', - 'EndpointAuthMode', - 'EndpointComputeType', - 'EndpointProvisioningState', - 'EnvironmentType', - 'EnvironmentVariableType', - 'ExportFormatType', - 'FeatureLags', - 'FeaturizationMode', - 'ForecastHorizonMode', - 'ForecastingModels', - 'ForecastingPrimaryMetrics', - 'Goal', - 'IdentityConfigurationType', - 'ImageAnnotationType', - 'ImageType', - 'IncrementalDataRefresh', - 'InputDeliveryMode', - 'InstanceSegmentationPrimaryMetrics', - 'IsolationMode', - 'JobInputType', - 'JobLimitsType', - 'JobOutputType', - 'JobProvisioningState', - 'JobStatus', - 'JobType', - 'KeyType', - 'LearningRateScheduler', - 'ListViewType', - 'LoadBalancerType', - 'LogVerbosity', - 'MLAssistConfigurationType', - 'MLFlowAutologgerState', - 'ManagedNetworkStatus', - 'ManagedServiceIdentityType', - 'MediaType', - 'MlflowAutologger', - 'ModelSize', - 'MountAction', - 'MountState', - 'MultiSelect', - 'NCrossValidationsMode', - 'Network', - 'NlpLearningRateScheduler', - 'NodeState', - 'NodesValueType', - 'ObjectDetectionPrimaryMetrics', - 'OperatingSystemType', - 'OperationName', - 'OperationStatus', - 'OperationTrigger', - 'OrderString', - 'OsType', - 'OutputDeliveryMode', - 'PrivateEndpointConnectionProvisioningState', - 'PrivateEndpointServiceConnectionStatus', - 'Protocol', - 'ProvisioningState', - 'ProvisioningStatus', - 'PublicNetworkAccess', - 'PublicNetworkAccessType', - 'QuotaUnit', - 'RandomSamplingAlgorithmRule', - 'RecurrenceFrequency', - 'ReferenceType', - 'RegressionModels', - 'RegressionPrimaryMetrics', - 'RemoteLoginPortPublicAccess', - 'RuleCategory', - 'RuleStatus', - 'RuleType', - 'SamplingAlgorithmType', - 'ScaleType', - 'ScheduleActionType', - 'ScheduleListViewType', - 'ScheduleProvisioningState', - 'ScheduleProvisioningStatus', - 'ScheduleStatus', - 'SeasonalityMode', - 'SecretsType', - 'ServiceDataAccessAuthIdentity', - 'ShortSeriesHandlingConfiguration', - 'SkuScaleType', - 'SkuTier', - 'SourceType', - 'SparkJobEntryType', - 'SshPublicAccess', - 'SslConfigStatus', - 'StackMetaLearnerType', - 'Status', - 'StatusMessageLevel', - 'StochasticOptimizer', - 'StorageAccountType', - 'TargetAggregationFunction', - 'TargetLagsMode', - 'TargetRollingWindowSizeMode', - 'TaskType', - 'TextAnnotationType', - 'TrainingMode', - 'TriggerType', - 'UnderlyingResourceAction', - 'UnitOfMeasure', - 'UsageUnit', - 'UseStl', - 'VMPriceOSType', - 'VMTier', - 'ValidationMetricType', - 'ValueFormat', - 'VmPriority', - 'VolumeDefinitionType', - 'WeekDay', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_azure_machine_learning_workspaces_enums.py deleted file mode 100644 index af8639765265..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_azure_machine_learning_workspaces_enums.py +++ /dev/null @@ -1,1572 +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 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 AssetProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Provisioning state of registry asset. - """ - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - -class AutoRebuildSetting(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AutoRebuild setting for the derived image - """ - - DISABLED = "Disabled" - ON_BASE_IMAGE_UPDATE = "OnBaseImageUpdate" - -class Autosave(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Auto save settings. - """ - - NONE = "None" - LOCAL = "Local" - REMOTE = "Remote" - -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 BillingCurrency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Three lettered code specifying the currency of the VM price. Example: USD - """ - - USD = "USD" - -class BlockedTransformers(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """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(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Caching type of Data Disk. - """ - - NONE = "None" - READ_ONLY = "ReadOnly" - READ_WRITE = "ReadWrite" - -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 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): - """[Required] 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" - ACCESS_KEY = "AccessKey" - -class ConnectionCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Category of the connection - """ - - PYTHON_FEED = "PythonFeed" - CONTAINER_REGISTRY = "ContainerRegistry" - GIT = "Git" - FEATURE_STORE = "FeatureStore" - S3 = "S3" - SNOWFLAKE = "Snowflake" - AZURE_SQL_DB = "AzureSqlDb" - AZURE_SYNAPSE_ANALYTICS = "AzureSynapseAnalytics" - AZURE_MY_SQL_DB = "AzureMySqlDb" - AZURE_POSTGRES_DB = "AzurePostgresDb" - AZURE_DATA_LAKE_GEN2 = "AzureDataLakeGen2" - REDIS = "Redis" - -class ContainerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of container to retrieve logs from. - """ - - #: The container used to download models and score script. - STORAGE_INITIALIZER = "StorageInitializer" - #: The container used to serve user's request. - INFERENCE_SERVER = "InferenceServer" - #: The container used to collect payload and custom logging when mdc is enabled. - MODEL_DATA_COLLECTOR = "ModelDataCollector" - -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 = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "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 DiagnoseResultLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level of workspace setup error - """ - - WARNING = "Warning" - ERROR = "Error" - INFORMATION = "Information" - -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 EncryptionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether or not the encryption is enabled for the workspace. - """ - - 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 EnvironmentVariableType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the Environment Variable. Possible values are: local - For local variable - """ - - LOCAL = "local" - -class ExportFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The format of exported labels. - """ - - DATASET = "Dataset" - COCO = "Coco" - CSV = "CSV" - -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 ImageAnnotationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Annotation type of image data. - """ - - CLASSIFICATION = "Classification" - BOUNDING_BOX = "BoundingBox" - INSTANCE_SEGMENTATION = "InstanceSegmentation" - -class ImageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the image. Possible values are: docker - For docker images. azureml - For AzureML - images - """ - - DOCKER = "docker" - AZUREML = "azureml" - -class IncrementalDataRefresh(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether IncrementalDataRefresh is enabled - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -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 IsolationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Isolation mode for the managed network of a machine learning workspace. - """ - - DISABLED = "Disabled" - ALLOW_INTERNET_OUTBOUND = "AllowInternetOutbound" - ALLOW_ONLY_APPROVED_OUTBOUND = "AllowOnlyApprovedOutbound" - -class JobInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """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(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - COMMAND = "Command" - SWEEP = "Sweep" - -class JobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """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 JobProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the job provisioning state. - """ - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - IN_PROGRESS = "InProgress" - -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" - LABELING = "Labeling" - SWEEP = "Sweep" - PIPELINE = "Pipeline" - SPARK = "Spark" - -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 LoadBalancerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Load Balancer Type - """ - - PUBLIC_IP = "PublicIp" - INTERNAL_LOAD_BALANCER = "InternalLoadBalancer" - -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 ManagedNetworkStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status for the managed network of a machine learning workspace. - """ - - INACTIVE = "Inactive" - ACTIVE = "Active" - -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 MediaType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Media type of data asset. - """ - - IMAGE = "Image" - TEXT = "Text" - -class MLAssistConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class MlflowAutologger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether mlflow autologger is enabled for notebooks. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class MLFlowAutologgerState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the state of mlflow autologger. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -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 MountAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount Action. - """ - - MOUNT = "Mount" - UNMOUNT = "Unmount" - -class MountState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount state. - """ - - MOUNT_REQUESTED = "MountRequested" - MOUNTED = "Mounted" - MOUNT_FAILED = "MountFailed" - UNMOUNT_REQUESTED = "UnmountRequested" - UNMOUNT_FAILED = "UnmountFailed" - UNMOUNTED = "Unmounted" - -class MultiSelect(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether multiSelect is enabled - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -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 Network(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """network of this container. - """ - - BRIDGE = "Bridge" - HOST = "Host" - -class NlpLearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum of learning rate schedulers that aligns with those supported by HF - """ - - #: No learning rate schedule. - NONE = "None" - #: Linear warmup and decay. - LINEAR = "Linear" - #: Linear warmup then cosine decay. - COSINE = "Cosine" - #: Linear warmup, cosine decay, then restart to initial LR. - COSINE_WITH_RESTARTS = "CosineWithRestarts" - #: Increase linearly then polynomially decay. - POLYNOMIAL = "Polynomial" - #: Constant learning rate. - CONSTANT = "Constant" - #: Linear warmup followed by constant value. - CONSTANT_WITH_WARMUP = "ConstantWithWarmup" - -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 NodesValueType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The enumerated types for the nodes value - """ - - ALL = "All" - 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 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 OperationTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Trigger of operation. - """ - - USER = "User" - SCHEDULE = "Schedule" - IDLE_SHUTDOWN = "IdleShutdown" - -class OrderString(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - CREATED_AT_DESC = "CreatedAtDesc" - CREATED_AT_ASC = "CreatedAtAsc" - UPDATED_AT_DESC = "UpdatedAtDesc" - UPDATED_AT_ASC = "UpdatedAtAsc" - -class OsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Compute OS Type - """ - - LINUX = "Linux" - WINDOWS = "Windows" - -class OutputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Output data delivery mode enums. - """ - - READ_WRITE_MOUNT = "ReadWriteMount" - UPLOAD = "Upload" - DIRECT = "Direct" - -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 Protocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Protocol over which communication will happen over this endpoint - """ - - TCP = "tcp" - UDP = "udp" - HTTP = "http" - -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" - SOFT_DELETED = "SoftDeleted" - -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 PublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class QuotaUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of quota measurement. - """ - - COUNT = "Count" - -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 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 RuleCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Category of a managed network Outbound Rule of a machine learning workspace. - """ - - REQUIRED = "Required" - RECOMMENDED = "Recommended" - USER_DEFINED = "UserDefined" - -class RuleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of a managed network Outbound Rule of a machine learning workspace. - """ - - INACTIVE = "Inactive" - ACTIVE = "Active" - -class RuleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of a managed network Outbound Rule of a machine learning workspace. - """ - - FQDN = "FQDN" - PRIVATE_ENDPOINT = "PrivateEndpoint" - SERVICE_TAG = "ServiceTag" - -class SamplingAlgorithmType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - GRID = "Grid" - RANDOM = "Random" - BAYESIAN = "Bayesian" - -class ScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - DEFAULT = "Default" - TARGET_UTILIZATION = "TargetUtilization" - -class ScheduleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - CREATE_JOB = "CreateJob" - INVOKE_BATCH_ENDPOINT = "InvokeBatchEndpoint" - -class ScheduleListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - ENABLED_ONLY = "EnabledOnly" - DISABLED_ONLY = "DisabledOnly" - ALL = "All" - -class ScheduleProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current deployment state of schedule. - """ - - COMPLETED = "Completed" - PROVISIONING = "Provisioning" - FAILED = "Failed" - -class ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - -class ScheduleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Is the schedule enabled or disabled? - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -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 SourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Data source type. - """ - - DATASET = "Dataset" - DATASTORE = "Datastore" - URI = "URI" - -class SparkJobEntryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - SPARK_JOB_PYTHON_ENTRY = "SparkJobPythonEntry" - SPARK_JOB_SCALA_ENTRY = "SparkJobScalaEntry" - -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 SslConfigStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enable or disable ssl for scoring - """ - - DISABLED = "Disabled" - ENABLED = "Enabled" - 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" - #: 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(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 StatusMessageLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - ERROR = "Error" - INFORMATION = "Information" - WARNING = "Warning" - -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 StorageAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """type of this storage account. - """ - - STANDARD_LRS = "Standard_LRS" - PREMIUM_LRS = "Premium_LRS" - -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 TextAnnotationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Annotation type of text data. - """ - - CLASSIFICATION = "Classification" - NAMED_ENTITY_RECOGNITION = "NamedEntityRecognition" - -class TrainingMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Training mode dictates whether to use distributed training or not - """ - - #: Auto mode. - AUTO = "Auto" - #: Distributed training mode. - DISTRIBUTED = "Distributed" - #: Non distributed training mode. - NON_DISTRIBUTED = "NonDistributed" - -class TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - 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 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 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" - -class VolumeDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe - """ - - BIND = "bind" - VOLUME = "volume" - TMPFS = "tmpfs" - NPIPE = "npipe" - -class WeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """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/v2022_12_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_models.py deleted file mode 100644 index ee6cd0648ca6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_models.py +++ /dev/null @@ -1,24269 +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: AccessKeyAuthTypeWorkspaceConnectionProperties, 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 - """ - - _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'}, - } - - _subtype_map = { - 'auth_type': {'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', '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", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 - """ - 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) - - -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """AccessKeyAuthTypeWorkspaceConnectionProperties. - - 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 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 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 AcrDetails(msrest.serialization.Model): - """Details of ACR account to be used for the Registry. - - :ivar system_created_acr_account: - :vartype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :ivar user_created_acr_account: - :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: - :paramtype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :keyword user_created_acr_account: - :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", "SoftDeleted". - :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", "SoftDeleted". - :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 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", "Custom". - :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", "Custom". - :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", "SoftDeleted". - :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 AmlOperation(msrest.serialization.Model): - """Azure Machine Learning 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.AmlOperationDisplay - :ivar is_data_action: Indicates whether the operation applies to data-plane. - :vartype is_data_action: bool - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'AmlOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - } - - 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.AmlOperationDisplay - :keyword is_data_action: Indicates whether the operation applies to data-plane. - :paramtype is_data_action: bool - """ - super(AmlOperation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.is_data_action = kwargs.get('is_data_action', None) - - -class AmlOperationDisplay(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(AmlOperationDisplay, 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 AmlOperationListResult(msrest.serialization.Model): - """An array of operations supported by the resource provider. - - :ivar value: List of AML operations supported by the AML resource provider. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlOperation]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: List of AML operations supported by the AML resource provider. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] - """ - super(AmlOperationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', 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 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 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, '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 asset_version: Output Asset Version. - :vartype asset_version: 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'}, - 'asset_version': {'key': 'assetVersion', '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 asset_version: Output Asset Version. - :paramtype asset_version: 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.asset_version = kwargs.get('asset_version', 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 AutologgerSettings(msrest.serialization.Model): - """Settings for Autologger. - - All required parameters must be populated in order to send to Azure. - - :ivar mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is enabled. - Possible values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - - _validation = { - 'mlflow_autologger': {'required': True}, - } - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is - enabled. Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - super(AutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = kwargs['mlflow_autologger'] - - -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, LabelingJobProperties, 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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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}'}, - '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'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Labeling': 'LabelingJobProperties', '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 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.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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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.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'}, - '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': '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 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.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.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, 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(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", "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 = { - '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", "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 = { - '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", "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 = { - '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 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", "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 = { - '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 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 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 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.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'}, - '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 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.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.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 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 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 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', 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 - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - - _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'}, - 'training_mode': {'key': 'trainingMode', '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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - 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) - self.training_mode = kwargs.get('training_mode', 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - '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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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 ExportSummary(msrest.serialization.Model): - """ExportSummary. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CsvExportSummary, CocoExportSummary, DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - } - - _subtype_map = { - 'format': {'CSV': 'CsvExportSummary', 'Coco': 'CocoExportSummary', 'Dataset': 'DatasetExportSummary'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ExportSummary, self).__init__(**kwargs) - self.end_date_time = None - self.exported_row_count = None - self.format = None # type: Optional[str] - self.labeling_job_id = None - self.start_date_time = None - - -class CocoExportSummary(ExportSummary): - """CocoExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CocoExportSummary, self).__init__(**kwargs) - self.format = 'Coco' # type: str - self.container_name = None - self.snapshot_path = 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(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.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(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.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 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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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 autologger_settings: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :vartype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :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.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, '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'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'AutologgerSettings'}, - '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': '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 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 autologger_settings: Distribution configuration of the job. If set, this should be one - of Mpi, Tensorflow, PyTorch, or null. - :paramtype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :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.JobResourceConfiguration - """ - super(CommandJob, self).__init__(**kwargs) - self.job_type = 'Command' # type: str - self.autologger_settings = kwargs.get('autologger_settings', None) - 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 ComponentContainer(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.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(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.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", "SoftDeleted". - :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 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'}, - '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 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.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", "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 - :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", "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 - :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", "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 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'}, - '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 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.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 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.TriggerType - :ivar recurrence: Required if triggerType is Recurrence. - :vartype recurrence: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :ivar cron: Required if triggerType is Cron. - :vartype cron: ~azure.mgmt.machinelearningservices.models.CronTrigger - :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': 'RecurrenceTrigger'}, - 'cron': {'key': 'cron', 'type': 'CronTrigger'}, - '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.TriggerType - :keyword recurrence: Required if triggerType is Recurrence. - :paramtype recurrence: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :keyword cron: Required if triggerType is Cron. - :paramtype cron: ~azure.mgmt.machinelearningservices.models.CronTrigger - :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 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 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, '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 CsvExportSummary(ExportSummary): - """CsvExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CsvExportSummary, self).__init__(**kwargs) - self.format = 'CSV' # type: str - self.container_name = None - self.snapshot_path = None - - -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", "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, '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 asset_version: Output Asset Version. - :vartype asset_version: 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'}, - 'asset_version': {'key': 'assetVersion', '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 asset_version: Output Asset Version. - :paramtype asset_version: 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.asset_version = kwargs.get('asset_version', 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 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] - """ - - _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]'}, - } - - 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] - """ - 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) - - -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", "SoftDeleted". - :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 DataContainer(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.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 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", "SoftDeleted". - :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", "SoftDeleted". - :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 DatasetExportSummary(ExportSummary): - """DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar labeled_asset_name: The unique name of the labeled data asset. - :vartype labeled_asset_name: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'labeled_asset_name': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'labeled_asset_name': {'key': 'labeledAssetName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatasetExportSummary, self).__init__(**kwargs) - self.format = 'Dataset' # type: str - self.labeled_asset_name = None - - -class Datastore(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.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(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.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, '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", "ModelDataCollector". - :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", "ModelDataCollector". - :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 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 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 EncryptionKeyVaultProperties(msrest.serialization.Model): - """EncryptionKeyVaultProperties. - - 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(EncryptionKeyVaultProperties, 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 EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): - """EncryptionKeyVaultUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_identifier: Required. Key Vault uri to access the encryption key. - :vartype key_identifier: str - """ - - _validation = { - 'key_identifier': {'required': True}, - } - - _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword key_identifier: Required. Key Vault uri to access the encryption key. - :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 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.EncryptionKeyVaultProperties - """ - - _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': 'EncryptionKeyVaultProperties'}, - } - - 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.EncryptionKeyVaultProperties - """ - super(EncryptionProperty, self).__init__(**kwargs) - self.status = kwargs['status'] - self.identity = kwargs.get('identity', None) - self.key_vault_properties = kwargs['key_vault_properties'] - - -class EncryptionUpdateProperties(msrest.serialization.Model): - """EncryptionUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_vault_properties: Required. Customer Key vault properties. - :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. Customer Key vault properties. - :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 ScheduleActionBase(msrest.serialization.Model): - """ScheduleActionBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobScheduleAction, 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". - :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', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ScheduleActionBase, self).__init__(**kwargs) - self.action_type = None # type: Optional[str] - - -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". - :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(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.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(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.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 - """ - - _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'}, - } - - 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 - """ - 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 - - -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.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 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 - :ivar allow_role_assignments_on_resource_group_level: - :vartype allow_role_assignments_on_resource_group_level: bool - """ - - _attribute_map = { - 'compute_runtime': {'key': 'computeRuntime', 'type': 'ComputeRuntimeDto'}, - 'offline_store_connection_name': {'key': 'offlineStoreConnectionName', 'type': 'str'}, - 'online_store_connection_name': {'key': 'onlineStoreConnectionName', 'type': 'str'}, - 'allow_role_assignments_on_resource_group_level': {'key': 'allowRoleAssignmentsOnResourceGroupLevel', 'type': 'bool'}, - } - - 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 - :keyword allow_role_assignments_on_resource_group_level: - :paramtype allow_role_assignments_on_resource_group_level: bool - """ - 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) - self.allow_role_assignments_on_resource_group_level = kwargs.get('allow_role_assignments_on_resource_group_level', 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 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - '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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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 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 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. - - All required parameters must be populated in order to send to Azure. - - :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 status: Status 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 category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'FQDN': 'FqdnOutboundRule', 'PrivateEndpoint': 'PrivateEndpointOutboundRule', 'ServiceTag': 'ServiceTagOutboundRule'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Status 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 category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - """ - super(OutboundRule, self).__init__(**kwargs) - self.type = None # type: Optional[str] - self.status = kwargs.get('status', None) - self.category = kwargs.get('category', None) - - -class FqdnOutboundRule(OutboundRule): - """FQDN Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :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 status: Status 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 category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar destination: - :vartype destination: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Status 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 category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword destination: - :paramtype destination: str - """ - super(FqdnOutboundRule, self).__init__(**kwargs) - self.type = 'FQDN' # type: str - self.destination = kwargs.get('destination', 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(DatastoreProperties): - """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 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", "SoftDeleted". - :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, '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 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 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 images. Possible values include: "docker", "azureml". Default value: "docker". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :ivar reference: Image reference URL. - :vartype reference: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', '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 images. Possible values include: "docker", "azureml". Default value: "docker". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :keyword reference: Image reference URL. - :paramtype reference: 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) - - -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. - - :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 - """ - - _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'}, - } - - 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) - - -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 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(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.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". - :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 set by user. - :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 set by user. - :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 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'] - - -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'] - - -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 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", "SoftDeleted". - :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 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 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'}, - '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 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.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 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 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'}, - '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 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 LabelCategory(msrest.serialization.Model): - """Label category definition. - - :ivar classes: Dictionary of label classes in this category. - :vartype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :ivar display_name: Display name of the label category. - :vartype display_name: str - :ivar multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :vartype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - - _attribute_map = { - 'classes': {'key': 'classes', 'type': '{LabelClass}'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'multi_select': {'key': 'multiSelect', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword classes: Dictionary of label classes in this category. - :paramtype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :keyword display_name: Display name of the label category. - :paramtype display_name: str - :keyword multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :paramtype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - super(LabelCategory, self).__init__(**kwargs) - self.classes = kwargs.get('classes', None) - self.display_name = kwargs.get('display_name', None) - self.multi_select = kwargs.get('multi_select', None) - - -class LabelClass(msrest.serialization.Model): - """Label class definition. - - :ivar display_name: Display name of the label class. - :vartype display_name: str - :ivar subclasses: Dictionary of subclasses of the label class. - :vartype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword display_name: Display name of the label class. - :paramtype display_name: str - :keyword subclasses: Dictionary of subclasses of the label class. - :paramtype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - super(LabelClass, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.subclasses = kwargs.get('subclasses', None) - - -class LabelingDataConfiguration(msrest.serialization.Model): - """Labeling data configuration definition. - - :ivar data_id: Resource Id of the data asset to perform labeling. - :vartype data_id: str - :ivar incremental_data_refresh: Indicates whether to enable incremental data refresh. Possible - values include: "Enabled", "Disabled". - :vartype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - - _attribute_map = { - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'incremental_data_refresh': {'key': 'incrementalDataRefresh', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_id: Resource Id of the data asset to perform labeling. - :paramtype data_id: str - :keyword incremental_data_refresh: Indicates whether to enable incremental data refresh. - Possible values include: "Enabled", "Disabled". - :paramtype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - super(LabelingDataConfiguration, self).__init__(**kwargs) - self.data_id = kwargs.get('data_id', None) - self.incremental_data_refresh = kwargs.get('incremental_data_refresh', None) - - -class LabelingJob(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.LabelingJobProperties - """ - - _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': 'LabelingJobProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - super(LabelingJob, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class LabelingJobMediaProperties(msrest.serialization.Model): - """Properties of a labeling job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LabelingJobImageProperties, LabelingJobTextProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - } - - _subtype_map = { - 'media_type': {'Image': 'LabelingJobImageProperties', 'Text': 'LabelingJobTextProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(LabelingJobMediaProperties, self).__init__(**kwargs) - self.media_type = None # type: Optional[str] - - -class LabelingJobImageProperties(LabelingJobMediaProperties): - """Properties of a labeling job for image data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - super(LabelingJobImageProperties, self).__init__(**kwargs) - self.media_type = 'Image' # type: str - self.annotation_type = kwargs.get('annotation_type', None) - - -class LabelingJobInstructions(msrest.serialization.Model): - """Instructions for labeling job. - - :ivar uri: The link to a page with detailed labeling instructions for labelers. - :vartype uri: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword uri: The link to a page with detailed labeling instructions for labelers. - :paramtype uri: str - """ - super(LabelingJobInstructions, self).__init__(**kwargs) - self.uri = kwargs.get('uri', None) - - -class LabelingJobProperties(JobBaseProperties): - """Labeling 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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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 created_date_time: Created time of the job in UTC timezone. - :vartype created_date_time: ~datetime.datetime - :ivar data_configuration: Configuration of data used in the job. - :vartype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :ivar job_instructions: Labeling instructions of the job. - :vartype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :ivar label_categories: Label categories of the job. - :vartype label_categories: dict[str, ~azure.mgmt.machinelearningservices.models.LabelCategory] - :ivar labeling_job_media_properties: Media type specific properties in the job. - :vartype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :ivar ml_assist_configuration: Configuration of MLAssist feature in the job. - :vartype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - :ivar progress_metrics: Progress metrics of the job. - :vartype progress_metrics: ~azure.mgmt.machinelearningservices.models.ProgressMetrics - :ivar project_id: Internal id of the job(Previously called project). - :vartype project_id: str - :ivar provisioning_state: Specifies the labeling job provisioning state. Possible values - include: "Succeeded", "Failed", "Canceled", "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.JobProvisioningState - :ivar status_messages: Status messages of the job. - :vartype status_messages: list[~azure.mgmt.machinelearningservices.models.StatusMessage] - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'progress_metrics': {'readonly': True}, - 'project_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status_messages': {'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'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'data_configuration': {'key': 'dataConfiguration', 'type': 'LabelingDataConfiguration'}, - 'job_instructions': {'key': 'jobInstructions', 'type': 'LabelingJobInstructions'}, - 'label_categories': {'key': 'labelCategories', 'type': '{LabelCategory}'}, - 'labeling_job_media_properties': {'key': 'labelingJobMediaProperties', 'type': 'LabelingJobMediaProperties'}, - 'ml_assist_configuration': {'key': 'mlAssistConfiguration', 'type': 'MLAssistConfiguration'}, - 'progress_metrics': {'key': 'progressMetrics', 'type': 'ProgressMetrics'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status_messages': {'key': 'statusMessages', 'type': '[StatusMessage]'}, - } - - 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 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_configuration: Configuration of data used in the job. - :paramtype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :keyword job_instructions: Labeling instructions of the job. - :paramtype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :keyword label_categories: Label categories of the job. - :paramtype label_categories: dict[str, - ~azure.mgmt.machinelearningservices.models.LabelCategory] - :keyword labeling_job_media_properties: Media type specific properties in the job. - :paramtype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :keyword ml_assist_configuration: Configuration of MLAssist feature in the job. - :paramtype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - """ - super(LabelingJobProperties, self).__init__(**kwargs) - self.job_type = 'Labeling' # type: str - self.created_date_time = None - self.data_configuration = kwargs.get('data_configuration', None) - self.job_instructions = kwargs.get('job_instructions', None) - self.label_categories = kwargs.get('label_categories', None) - self.labeling_job_media_properties = kwargs.get('labeling_job_media_properties', None) - self.ml_assist_configuration = kwargs.get('ml_assist_configuration', None) - self.progress_metrics = None - self.project_id = None - self.provisioning_state = None - self.status_messages = None - - -class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of LabelingJob entities. - - :ivar next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type LabelingJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[LabelingJob]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type LabelingJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - super(LabelingJobResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class LabelingJobTextProperties(LabelingJobMediaProperties): - """Properties of a labeling job for text data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - super(LabelingJobTextProperties, self).__init__(**kwargs) - self.media_type = 'Text' # type: str - self.annotation_type = kwargs.get('annotation_type', 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 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, '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 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 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 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 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 - :ivar spark_ready: - :vartype spark_ready: bool - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'spark_ready': {'key': 'sparkReady', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :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 - :keyword spark_ready: - :paramtype spark_ready: bool - """ - super(ManagedNetworkProvisionStatus, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.spark_ready = kwargs.get('spark_ready', 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 - """ - - _validation = { - 'network_id': {'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'}, - } - - 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) - - -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 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 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'}, - '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 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 MLAssistConfiguration(msrest.serialization.Model): - """Labeling MLAssist configuration definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLAssistConfigurationDisabled, MLAssistConfigurationEnabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - _subtype_map = { - 'ml_assist': {'Disabled': 'MLAssistConfigurationDisabled', 'Enabled': 'MLAssistConfigurationEnabled'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfiguration, self).__init__(**kwargs) - self.ml_assist = None # type: Optional[str] - - -class MLAssistConfigurationDisabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is disabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfigurationDisabled, self).__init__(**kwargs) - self.ml_assist = 'Disabled' # type: str - - -class MLAssistConfigurationEnabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is enabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - :ivar inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :vartype inferencing_compute_binding: str - :ivar training_compute_binding: Required. [Required] AML compute binding used in training. - :vartype training_compute_binding: str - """ - - _validation = { - 'ml_assist': {'required': True}, - 'inferencing_compute_binding': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_compute_binding': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - 'inferencing_compute_binding': {'key': 'inferencingComputeBinding', 'type': 'str'}, - 'training_compute_binding': {'key': 'trainingComputeBinding', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :paramtype inferencing_compute_binding: str - :keyword training_compute_binding: Required. [Required] AML compute binding used in training. - :paramtype training_compute_binding: str - """ - super(MLAssistConfigurationEnabled, self).__init__(**kwargs) - self.ml_assist = 'Enabled' # type: str - self.inferencing_compute_binding = kwargs['inferencing_compute_binding'] - self.training_compute_binding = kwargs['training_compute_binding'] - - -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, '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 asset_version: Output Asset Version. - :vartype asset_version: 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'}, - 'asset_version': {'key': 'assetVersion', '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 asset_version: Output Asset Version. - :paramtype asset_version: 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.asset_version = kwargs.get('asset_version', 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, '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, '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 asset_version: Output Asset Version. - :vartype asset_version: 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'}, - 'asset_version': {'key': 'assetVersion', '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 asset_version: Output Asset Version. - :paramtype asset_version: 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.asset_version = kwargs.get('asset_version', 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(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.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 ModelVersion(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.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 - """ - - _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'}, - } - - 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 - """ - 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 - - -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 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 NlpFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML NLP training. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: int - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: int - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: int - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: int - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: float - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: float - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'float'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: int - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: int - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: int - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: int - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: float - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: float - """ - super(NlpFixedParameters, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get('gradient_accumulation_steps', 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.number_of_epochs = kwargs.get('number_of_epochs', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_ratio = kwargs.get('warmup_ratio', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class NlpParameterSubspace(msrest.serialization.Model): - """Stringified search spaces for each parameter. See below examples. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :vartype learning_rate_scheduler: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: str - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: str - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: str - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: str - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: str - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :paramtype learning_rate_scheduler: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: str - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: str - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: str - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: str - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: str - """ - super(NlpParameterSubspace, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get('gradient_accumulation_steps', 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.number_of_epochs = kwargs.get('number_of_epochs', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_ratio = kwargs.get('warmup_ratio', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class NlpSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter tuning related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. 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 for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(NlpSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - - -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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_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_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Timeout for individual HD trials. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Timeout for individual HD trials. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_nodes = kwargs.get('max_nodes', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") - self.trial_timeout = kwargs.get('trial_timeout', 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 - """ - - _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'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 - """ - 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", "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 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 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 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: 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 OutboundRuleBasicResource(Resource): - """Outbound Rule Basic Resource 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 id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the 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 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] - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OutboundRuleBasicResource]'}, - '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.OutboundRuleBasicResource] - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - """ - super(OutboundRuleListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', 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 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.PartialManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Additional attributes of the entity. - :vartype properties: any - :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'}, - 'properties': {'key': 'properties', 'type': 'object'}, - '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 properties: Additional attributes of the entity. - :paramtype properties: any - :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.kind = kwargs.get('kind', None) - self.properties = kwargs.get('properties', 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. - - 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 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 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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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 - :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'}, - '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 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 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 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 - :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'}, - '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'}, - '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.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 - :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.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 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 subresource_target: - :vartype subresource_target: str - :ivar spark_enabled: - :vartype spark_enabled: bool - :ivar spark_status: Status 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 - """ - - _attribute_map = { - 'service_resource_id': {'key': 'serviceResourceId', 'type': 'str'}, - 'subresource_target': {'key': 'subresourceTarget', 'type': 'str'}, - 'spark_enabled': {'key': 'sparkEnabled', 'type': 'bool'}, - 'spark_status': {'key': 'sparkStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword service_resource_id: - :paramtype service_resource_id: str - :keyword subresource_target: - :paramtype subresource_target: str - :keyword spark_enabled: - :paramtype spark_enabled: bool - :keyword spark_status: Status 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 - """ - super(PrivateEndpointDestination, self).__init__(**kwargs) - self.service_resource_id = kwargs.get('service_resource_id', None) - self.subresource_target = kwargs.get('subresource_target', None) - self.spark_enabled = kwargs.get('spark_enabled', None) - self.spark_status = kwargs.get('spark_status', None) - - -class PrivateEndpointOutboundRule(OutboundRule): - """Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :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 status: Status 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 category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :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 - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'PrivateEndpointDestination'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Status 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 category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :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 - """ - super(PrivateEndpointOutboundRule, self).__init__(**kwargs) - self.type = 'PrivateEndpoint' # type: str - self.destination = kwargs.get('destination', 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: 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 - :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'}, - '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'}, - '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.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 - :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.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 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 ProgressMetrics(msrest.serialization.Model): - """Progress metrics definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar completed_datapoint_count: The completed datapoint count. - :vartype completed_datapoint_count: long - :ivar incremental_data_last_refresh_date_time: The time of last successful incremental data - refresh in UTC. - :vartype incremental_data_last_refresh_date_time: ~datetime.datetime - :ivar skipped_datapoint_count: The skipped datapoint count. - :vartype skipped_datapoint_count: long - :ivar total_datapoint_count: The total datapoint count. - :vartype total_datapoint_count: long - """ - - _validation = { - 'completed_datapoint_count': {'readonly': True}, - 'incremental_data_last_refresh_date_time': {'readonly': True}, - 'skipped_datapoint_count': {'readonly': True}, - 'total_datapoint_count': {'readonly': True}, - } - - _attribute_map = { - 'completed_datapoint_count': {'key': 'completedDatapointCount', 'type': 'long'}, - 'incremental_data_last_refresh_date_time': {'key': 'incrementalDataLastRefreshDateTime', 'type': 'iso-8601'}, - 'skipped_datapoint_count': {'key': 'skippedDatapointCount', 'type': 'long'}, - 'total_datapoint_count': {'key': 'totalDatapointCount', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProgressMetrics, self).__init__(**kwargs) - self.completed_datapoint_count = None - self.incremental_data_last_refresh_date_time = None - self.skipped_datapoint_count = None - self.total_datapoint_count = 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 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 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 logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :vartype logbase: str - :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'}, - 'logbase': {'key': 'logbase', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :paramtype logbase: str - :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.logbase = kwargs.get('logbase', None) - self.rule = kwargs.get('rule', None) - self.seed = kwargs.get('seed', 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 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 properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RegistryProperties - :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': 'RegistryProperties'}, - '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.RegistryProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(Registry, 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 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 RegistryProperties(ResourceBase): - """Details of the Registry. - - :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 public_network_access: - :vartype public_network_access: str - :ivar discovery_url: - :vartype discovery_url: str - :ivar intellectual_property_publisher: - :vartype intellectual_property_publisher: str - :ivar managed_resource_group: Managed resource group created for the registry. - :vartype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar ml_flow_registry_uri: - :vartype ml_flow_registry_uri: str - :ivar private_link_count: - :vartype private_link_count: int - :ivar region_details: Details of each region the registry is in. - :vartype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - :ivar managed_resource_group_tags: Tags to be applied to the managed resource group associated - with this registry. - :vartype managed_resource_group_tags: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'discovery_url': {'key': 'discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'managedResourceGroup', 'type': 'ArmResourceId'}, - 'ml_flow_registry_uri': {'key': 'mlFlowRegistryUri', 'type': 'str'}, - 'private_link_count': {'key': 'privateLinkCount', 'type': 'int'}, - 'region_details': {'key': 'regionDetails', 'type': '[RegistryRegionArmDetails]'}, - 'managed_resource_group_tags': {'key': 'managedResourceGroupTags', '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 public_network_access: - :paramtype public_network_access: str - :keyword discovery_url: - :paramtype discovery_url: str - :keyword intellectual_property_publisher: - :paramtype intellectual_property_publisher: str - :keyword managed_resource_group: Managed resource group created for the registry. - :paramtype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword ml_flow_registry_uri: - :paramtype ml_flow_registry_uri: str - :keyword private_link_count: - :paramtype private_link_count: int - :keyword region_details: Details of each region the registry is in. - :paramtype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - :keyword managed_resource_group_tags: Tags to be applied to the managed resource group - associated with this registry. - :paramtype managed_resource_group_tags: dict[str, str] - """ - super(RegistryProperties, self).__init__(**kwargs) - self.public_network_access = kwargs.get('public_network_access', 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.ml_flow_registry_uri = kwargs.get('ml_flow_registry_uri', None) - self.private_link_count = kwargs.get('private_link_count', None) - self.region_details = kwargs.get('region_details', None) - self.managed_resource_group_tags = kwargs.get('managed_resource_group_tags', 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - '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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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 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 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 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 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 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 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(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.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 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 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 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", "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 ServiceTagDestination(msrest.serialization.Model): - """Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. - - :ivar service_tag: - :vartype service_tag: str - :ivar protocol: - :vartype protocol: str - :ivar port_ranges: - :vartype port_ranges: str - """ - - _attribute_map = { - 'service_tag': {'key': 'serviceTag', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'port_ranges': {'key': 'portRanges', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword service_tag: - :paramtype service_tag: str - :keyword protocol: - :paramtype protocol: str - :keyword port_ranges: - :paramtype port_ranges: str - """ - super(ServiceTagDestination, self).__init__(**kwargs) - self.service_tag = kwargs.get('service_tag', None) - self.protocol = kwargs.get('protocol', None) - self.port_ranges = kwargs.get('port_ranges', None) - - -class ServiceTagOutboundRule(OutboundRule): - """Service Tag Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :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 status: Status 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 category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :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 = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'ServiceTagDestination'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword status: Status 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 category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :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 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): - """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 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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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 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 resource 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 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 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, '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'}, - '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'}, - '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]'}, - '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 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 resource 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 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 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.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.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 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 StatusMessage(msrest.serialization.Model): - """Active message associated with project. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Service-defined message code. - :vartype code: str - :ivar created_date_time: Time in UTC at which the message was created. - :vartype created_date_time: ~datetime.datetime - :ivar level: Severity level of message. Possible values include: "Error", "Information", - "Warning". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.StatusMessageLevel - :ivar message: A human-readable representation of the message code. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(StatusMessage, self).__init__(**kwargs) - self.code = None - self.created_date_time = None - self.level = None - self.message = None - - -class StorageAccountDetails(msrest.serialization.Model): - """Details of storage account to be used for the Registry. - - :ivar system_created_storage_account: - :vartype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :ivar user_created_storage_account: - :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: - :paramtype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :keyword user_created_storage_account: - :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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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}'}, - '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'}, - '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 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 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 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", "SoftDeleted". - :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_sku: - :vartype acr_account_sku: str - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword acr_account_sku: - :paramtype acr_account_sku: str - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(SystemCreatedAcrAccount, self).__init__(**kwargs) - 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 arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar storage_account_hns_enabled: - :vartype storage_account_hns_enabled: bool - :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 - :ivar allow_blob_public_access: - :vartype allow_blob_public_access: bool - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - 'allow_blob_public_access': {'key': 'allowBlobPublicAccess', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword storage_account_hns_enabled: - :paramtype storage_account_hns_enabled: bool - :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 - :keyword allow_blob_public_access: - :paramtype allow_blob_public_access: bool - """ - super(SystemCreatedStorageAccount, self).__init__(**kwargs) - 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_type = kwargs.get('storage_account_type', None) - self.allow_blob_public_access = kwargs.get('allow_blob_public_access', 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 TableFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML Table training. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: int - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: int - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: int - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: int - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: float - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: int - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: int - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: float - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: float - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: float - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: float - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: bool - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: bool - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'max_bin': {'key': 'maxBin', 'type': 'int'}, - 'max_depth': {'key': 'maxDepth', 'type': 'int'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'int'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'int'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'float'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'int'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'int'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'float'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'float'}, - 'subsample': {'key': 'subsample', 'type': 'float'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'float'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'bool'}, - 'with_std': {'key': 'withStd', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: int - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: int - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: int - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: int - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: float - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: int - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: int - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: float - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: float - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: float - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: float - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: bool - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: bool - """ - super(TableFixedParameters, self).__init__(**kwargs) - self.booster = kwargs.get('booster', None) - self.boosting_type = kwargs.get('boosting_type', None) - self.grow_policy = kwargs.get('grow_policy', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.max_bin = kwargs.get('max_bin', None) - self.max_depth = kwargs.get('max_depth', None) - self.max_leaves = kwargs.get('max_leaves', None) - self.min_data_in_leaf = kwargs.get('min_data_in_leaf', None) - self.min_split_gain = kwargs.get('min_split_gain', None) - self.model_name = kwargs.get('model_name', None) - self.n_estimators = kwargs.get('n_estimators', None) - self.num_leaves = kwargs.get('num_leaves', None) - self.preprocessor_name = kwargs.get('preprocessor_name', None) - self.reg_alpha = kwargs.get('reg_alpha', None) - self.reg_lambda = kwargs.get('reg_lambda', None) - self.subsample = kwargs.get('subsample', None) - self.subsample_freq = kwargs.get('subsample_freq', None) - self.tree_method = kwargs.get('tree_method', None) - self.with_mean = kwargs.get('with_mean', False) - self.with_std = kwargs.get('with_std', False) - - -class TableParameterSubspace(msrest.serialization.Model): - """TableParameterSubspace. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: str - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: str - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: str - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: str - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: str - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: str - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: str - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: str - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: str - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: str - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: str - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: str - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'max_bin': {'key': 'maxBin', 'type': 'str'}, - 'max_depth': {'key': 'maxDepth', 'type': 'str'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'str'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'str'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'str'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'str'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'str'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'str'}, - 'subsample': {'key': 'subsample', 'type': 'str'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'str'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'str'}, - 'with_std': {'key': 'withStd', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: str - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: str - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: str - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: str - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: str - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: str - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: str - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: str - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: str - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: str - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: str - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: str - """ - super(TableParameterSubspace, self).__init__(**kwargs) - self.booster = kwargs.get('booster', None) - self.boosting_type = kwargs.get('boosting_type', None) - self.grow_policy = kwargs.get('grow_policy', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.max_bin = kwargs.get('max_bin', None) - self.max_depth = kwargs.get('max_depth', None) - self.max_leaves = kwargs.get('max_leaves', None) - self.min_data_in_leaf = kwargs.get('min_data_in_leaf', None) - self.min_split_gain = kwargs.get('min_split_gain', None) - self.model_name = kwargs.get('model_name', None) - self.n_estimators = kwargs.get('n_estimators', None) - self.num_leaves = kwargs.get('num_leaves', None) - self.preprocessor_name = kwargs.get('preprocessor_name', None) - self.reg_alpha = kwargs.get('reg_alpha', None) - self.reg_lambda = kwargs.get('reg_lambda', None) - self.subsample = kwargs.get('subsample', None) - self.subsample_freq = kwargs.get('subsample_freq', None) - self.tree_method = kwargs.get('tree_method', None) - self.with_mean = kwargs.get('with_mean', None) - self.with_std = kwargs.get('with_std', None) - - -class TableSweepSettings(msrest.serialization.Model): - """TableSweepSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. 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 for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(TableSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - - -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_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of iterations. - :vartype max_trials: int - :ivar sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to trigger. - :vartype sweep_concurrent_trials: int - :ivar sweep_trials: Number of sweeping runs that user wants to trigger. - :vartype sweep_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_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'sweep_concurrent_trials': {'key': 'sweepConcurrentTrials', 'type': 'int'}, - 'sweep_trials': {'key': 'sweepTrials', '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_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of iterations. - :paramtype max_trials: int - :keyword sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to - trigger. - :paramtype sweep_concurrent_trials: int - :keyword sweep_trials: Number of sweeping runs that user wants to trigger. - :paramtype sweep_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_nodes = kwargs.get('max_nodes', 1) - self.max_trials = kwargs.get('max_trials', 1000) - self.sweep_concurrent_trials = kwargs.get('sweep_concurrent_trials', 0) - self.sweep_trials = kwargs.get('sweep_trials', 0) - 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_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 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, '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, '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 asset_version: Output Asset Version. - :vartype asset_version: 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'}, - 'asset_version': {'key': 'assetVersion', '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 asset_version: Output Asset Version. - :paramtype asset_version: 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.asset_version = kwargs.get('asset_version', 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, '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, '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 asset_version: Output Asset Version. - :vartype asset_version: 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'}, - 'asset_version': {'key': 'assetVersion', '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 asset_version: Output Asset Version. - :paramtype asset_version: 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.asset_version = kwargs.get('asset_version', 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, '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, '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 asset_version: Output Asset Version. - :vartype asset_version: 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'}, - 'asset_version': {'key': 'assetVersion', '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 asset_version: Output Asset Version. - :paramtype asset_version: 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.asset_version = kwargs.get('asset_version', 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 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. - - 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 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", "SoftDeleted". - :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: 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 - :ivar kind: - :vartype kind: str - :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. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. - :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", - "SoftDeleted". - :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 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 - :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 soft_deleted_at: The timestamp when the workspace was soft deleted. - :vartype soft_deleted_at: str - :ivar scheduled_purge_date: The timestamp when the soft deleted workspace is going to be - purged. - :vartype scheduled_purge_date: str - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :vartype system_datastores_auth_mode: str - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - """ - - _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}, - 'soft_deleted_at': {'readonly': True}, - 'scheduled_purge_date': {'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'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'str'}, - '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'}, - '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'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'soft_deleted_at': {'key': 'properties.softDeletedAt', 'type': 'str'}, - 'scheduled_purge_date': {'key': 'properties.scheduledPurgeDate', 'type': 'str'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - } - - def __init__( - self, - **kwargs - ): - """ - :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 - :keyword kind: - :paramtype kind: str - :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. - :paramtype application_insights: str - :keyword container_registry: ARM id of the container registry associated with this workspace. - :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 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 - :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 system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :paramtype system_datastores_auth_mode: str - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - """ - 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.kind = kwargs.get('kind', 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.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 - self.v1_legacy_mode = kwargs.get('v1_legacy_mode', False) - self.soft_deleted_at = None - self.scheduled_purge_date = None - self.system_datastores_auth_mode = kwargs.get('system_datastores_auth_mode', None) - self.feature_store_settings = kwargs.get('feature_store_settings', None) - self.managed_network = kwargs.get('managed_network', 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 WorkspaceConnectionManagedIdentity(msrest.serialization.Model): - """WorkspaceConnectionManagedIdentity. - - :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(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', 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. - - 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 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 WorkspaceConnectionUsernamePassword(msrest.serialization.Model): - """WorkspaceConnectionUsernamePassword. - - :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(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', 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.ManagedServiceIdentity - :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 - :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 encryption: The encryption settings of the workspace. - :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 managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - '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'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionUpdateProperties'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - } - - 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.ManagedServiceIdentity - :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 - :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 encryption: The encryption settings of the workspace. - :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 managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - """ - 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) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.encryption = kwargs.get('encryption', None) - self.feature_store_settings = kwargs.get('feature_store_settings', None) - self.managed_network = kwargs.get('managed_network', None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_models_py3.py deleted file mode 100644 index 3b0b4eebd05f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_models_py3.py +++ /dev/null @@ -1,26376 +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: AccessKeyAuthTypeWorkspaceConnectionProperties, 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 - """ - - _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'}, - } - - _subtype_map = { - 'auth_type': {'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', '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, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 - """ - 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 - - -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """AccessKeyAuthTypeWorkspaceConnectionProperties. - - 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionAccessKey"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'AccessKey' # 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, 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 AcrDetails(msrest.serialization.Model): - """Details of ACR account to be used for the Registry. - - :ivar system_created_acr_account: - :vartype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :ivar user_created_acr_account: - :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: - :paramtype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :keyword user_created_acr_account: - :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", "SoftDeleted". - :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", "SoftDeleted". - :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 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", "Custom". - :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", "Custom". - :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", "SoftDeleted". - :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 AmlOperation(msrest.serialization.Model): - """Azure Machine Learning 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.AmlOperationDisplay - :ivar is_data_action: Indicates whether the operation applies to data-plane. - :vartype is_data_action: bool - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'AmlOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - display: Optional["AmlOperationDisplay"] = None, - is_data_action: Optional[bool] = None, - **kwargs - ): - """ - :keyword name: Operation name: {provider}/{resource}/{operation}. - :paramtype name: str - :keyword display: Display name of operation. - :paramtype display: ~azure.mgmt.machinelearningservices.models.AmlOperationDisplay - :keyword is_data_action: Indicates whether the operation applies to data-plane. - :paramtype is_data_action: bool - """ - super(AmlOperation, self).__init__(**kwargs) - self.name = name - self.display = display - self.is_data_action = is_data_action - - -class AmlOperationDisplay(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(AmlOperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description - - -class AmlOperationListResult(msrest.serialization.Model): - """An array of operations supported by the resource provider. - - :ivar value: List of AML operations supported by the AML resource provider. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlOperation]'}, - } - - def __init__( - self, - *, - value: Optional[List["AmlOperation"]] = None, - **kwargs - ): - """ - :keyword value: List of AML operations supported by the AML resource provider. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] - """ - super(AmlOperationListResult, self).__init__(**kwargs) - self.value = value - - -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 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 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, '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 asset_version: Output Asset Version. - :vartype asset_version: 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'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: 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 asset_version: Output Asset Version. - :paramtype asset_version: 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.asset_version = asset_version - 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 AutologgerSettings(msrest.serialization.Model): - """Settings for Autologger. - - All required parameters must be populated in order to send to Azure. - - :ivar mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is enabled. - Possible values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - - _validation = { - 'mlflow_autologger': {'required': True}, - } - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - *, - mlflow_autologger: Union[str, "MLFlowAutologgerState"], - **kwargs - ): - """ - :keyword mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is - enabled. Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - super(AutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = mlflow_autologger - - -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, LabelingJobProperties, 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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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}'}, - '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'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Labeling': 'LabelingJobProperties', '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, - 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 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.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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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.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'}, - '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': '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, - 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["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 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.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, 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 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, 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(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", "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 = { - '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", "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 = { - '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", "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 = { - '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 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", "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 = { - '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 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 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 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.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'}, - '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, - 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 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.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.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 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 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 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, 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.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - 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 - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - - _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'}, - 'training_mode': {'key': 'trainingMode', '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, - training_mode: Optional[Union[str, "TrainingMode"]] = 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - 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 - self.training_mode = training_mode - - -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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - '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, - training_mode: Optional[Union[str, "TrainingMode"]] = 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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, training_mode=training_mode, **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 ExportSummary(msrest.serialization.Model): - """ExportSummary. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CsvExportSummary, CocoExportSummary, DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - } - - _subtype_map = { - 'format': {'CSV': 'CsvExportSummary', 'Coco': 'CocoExportSummary', 'Dataset': 'DatasetExportSummary'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ExportSummary, self).__init__(**kwargs) - self.end_date_time = None - self.exported_row_count = None - self.format = None # type: Optional[str] - self.labeling_job_id = None - self.start_date_time = None - - -class CocoExportSummary(ExportSummary): - """CocoExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CocoExportSummary, self).__init__(**kwargs) - self.format = 'Coco' # type: str - self.container_name = None - self.snapshot_path = 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, - *, - 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(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.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(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.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 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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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 autologger_settings: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :vartype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :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.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, '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'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'AutologgerSettings'}, - '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': '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, - services: Optional[Dict[str, "JobService"]] = None, - autologger_settings: Optional["AutologgerSettings"] = 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["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 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 autologger_settings: Distribution configuration of the job. If set, this should be one - of Mpi, Tensorflow, PyTorch, or null. - :paramtype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :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.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, services=services, **kwargs) - self.job_type = 'Command' # type: str - self.autologger_settings = autologger_settings - 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 ComponentContainer(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.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(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.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", "SoftDeleted". - :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 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'}, - '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, - 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 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.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", "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 - :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", "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 - :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", "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 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'}, - '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", - 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 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.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 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.TriggerType - :ivar recurrence: Required if triggerType is Recurrence. - :vartype recurrence: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :ivar cron: Required if triggerType is Cron. - :vartype cron: ~azure.mgmt.machinelearningservices.models.CronTrigger - :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': 'RecurrenceTrigger'}, - 'cron': {'key': 'cron', 'type': 'CronTrigger'}, - '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, "TriggerType"]] = None, - recurrence: Optional["RecurrenceTrigger"] = None, - cron: Optional["CronTrigger"] = 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.TriggerType - :keyword recurrence: Required if triggerType is Recurrence. - :paramtype recurrence: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :keyword cron: Required if triggerType is Cron. - :paramtype cron: ~azure.mgmt.machinelearningservices.models.CronTrigger - :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 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 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, '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 CsvExportSummary(ExportSummary): - """CsvExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CsvExportSummary, self).__init__(**kwargs) - self.format = 'CSV' # type: str - self.container_name = None - self.snapshot_path = None - - -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", "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, '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 asset_version: Output Asset Version. - :vartype asset_version: 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'}, - 'asset_version': {'key': 'assetVersion', '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, - asset_version: 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 asset_version: Output Asset Version. - :paramtype asset_version: 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, asset_version=asset_version, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.mode = mode - self.uri = uri - self.job_output_type = 'custom_model' # type: str - self.description = description - - -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] - """ - - _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]'}, - } - - 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, - **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] - """ - 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 - - -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", "SoftDeleted". - :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 DataContainer(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.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 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", "SoftDeleted". - :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", "SoftDeleted". - :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 DatasetExportSummary(ExportSummary): - """DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar labeled_asset_name: The unique name of the labeled data asset. - :vartype labeled_asset_name: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'labeled_asset_name': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'labeled_asset_name': {'key': 'labeledAssetName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatasetExportSummary, self).__init__(**kwargs) - self.format = 'Dataset' # type: str - self.labeled_asset_name = None - - -class Datastore(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.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(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.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, '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", "ModelDataCollector". - :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", "ModelDataCollector". - :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 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 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 EncryptionKeyVaultProperties(msrest.serialization.Model): - """EncryptionKeyVaultProperties. - - 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(EncryptionKeyVaultProperties, 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 EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): - """EncryptionKeyVaultUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_identifier: Required. Key Vault uri to access the encryption key. - :vartype key_identifier: str - """ - - _validation = { - 'key_identifier': {'required': True}, - } - - _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - } - - def __init__( - self, - *, - key_identifier: str, - **kwargs - ): - """ - :keyword key_identifier: Required. Key Vault uri to access the encryption key. - :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 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.EncryptionKeyVaultProperties - """ - - _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': 'EncryptionKeyVaultProperties'}, - } - - def __init__( - self, - *, - status: Union[str, "EncryptionStatus"], - key_vault_properties: "EncryptionKeyVaultProperties", - identity: Optional["IdentityForCmk"] = 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.EncryptionKeyVaultProperties - """ - super(EncryptionProperty, self).__init__(**kwargs) - self.status = status - self.identity = identity - self.key_vault_properties = key_vault_properties - - -class EncryptionUpdateProperties(msrest.serialization.Model): - """EncryptionUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_vault_properties: Required. Customer Key vault properties. - :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. Customer Key vault properties. - :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 ScheduleActionBase(msrest.serialization.Model): - """ScheduleActionBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobScheduleAction, 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". - :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', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ScheduleActionBase, self).__init__(**kwargs) - self.action_type = None # type: Optional[str] - - -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". - :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(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.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(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.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 - """ - - _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'}, - } - - 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, - **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 - """ - 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 - - -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.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 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 - :ivar allow_role_assignments_on_resource_group_level: - :vartype allow_role_assignments_on_resource_group_level: bool - """ - - _attribute_map = { - 'compute_runtime': {'key': 'computeRuntime', 'type': 'ComputeRuntimeDto'}, - 'offline_store_connection_name': {'key': 'offlineStoreConnectionName', 'type': 'str'}, - 'online_store_connection_name': {'key': 'onlineStoreConnectionName', 'type': 'str'}, - 'allow_role_assignments_on_resource_group_level': {'key': 'allowRoleAssignmentsOnResourceGroupLevel', 'type': 'bool'}, - } - - def __init__( - self, - *, - compute_runtime: Optional["ComputeRuntimeDto"] = None, - offline_store_connection_name: Optional[str] = None, - online_store_connection_name: Optional[str] = None, - allow_role_assignments_on_resource_group_level: Optional[bool] = 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 - :keyword allow_role_assignments_on_resource_group_level: - :paramtype allow_role_assignments_on_resource_group_level: bool - """ - 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 - self.allow_role_assignments_on_resource_group_level = allow_role_assignments_on_resource_group_level - - -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 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, 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.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - '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, - training_mode: Optional[Union[str, "TrainingMode"]] = 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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, training_mode=training_mode, **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 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 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. - - All required parameters must be populated in order to send to Azure. - - :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 status: Status 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 category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'FQDN': 'FqdnOutboundRule', 'PrivateEndpoint': 'PrivateEndpointOutboundRule', 'ServiceTag': 'ServiceTagOutboundRule'} - } - - def __init__( - self, - *, - status: Optional[Union[str, "RuleStatus"]] = None, - category: Optional[Union[str, "RuleCategory"]] = None, - **kwargs - ): - """ - :keyword status: Status 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 category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - """ - super(OutboundRule, self).__init__(**kwargs) - self.type = None # type: Optional[str] - self.status = status - self.category = category - - -class FqdnOutboundRule(OutboundRule): - """FQDN Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :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 status: Status 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 category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :ivar destination: - :vartype destination: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'str'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "RuleStatus"]] = None, - category: Optional[Union[str, "RuleCategory"]] = None, - destination: Optional[str] = None, - **kwargs - ): - """ - :keyword status: Status 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 category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :keyword destination: - :paramtype destination: str - """ - super(FqdnOutboundRule, self).__init__(status=status, category=category, **kwargs) - self.type = 'FQDN' # type: str - self.destination = destination - - -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(DatastoreProperties): - """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 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", "SoftDeleted". - :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, '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 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 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 images. Possible values include: "docker", "azureml". Default value: "docker". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :ivar reference: Image reference URL. - :vartype reference: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - type: Optional[Union[str, "ImageType"]] = "docker", - reference: 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 images. Possible values include: "docker", "azureml". Default value: "docker". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :keyword reference: Image reference URL. - :paramtype reference: str - """ - super(Image, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.type = type - self.reference = reference - - -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. - - :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 - """ - - _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'}, - } - - 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 - - -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 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(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.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". - :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 set by user. - :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 set by user. - :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 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 - - -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 - - -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 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", "SoftDeleted". - :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 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 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'}, - '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, - 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 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.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 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 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'}, - '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, - 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 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, 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 LabelCategory(msrest.serialization.Model): - """Label category definition. - - :ivar classes: Dictionary of label classes in this category. - :vartype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :ivar display_name: Display name of the label category. - :vartype display_name: str - :ivar multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :vartype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - - _attribute_map = { - 'classes': {'key': 'classes', 'type': '{LabelClass}'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'multi_select': {'key': 'multiSelect', 'type': 'str'}, - } - - def __init__( - self, - *, - classes: Optional[Dict[str, "LabelClass"]] = None, - display_name: Optional[str] = None, - multi_select: Optional[Union[str, "MultiSelect"]] = None, - **kwargs - ): - """ - :keyword classes: Dictionary of label classes in this category. - :paramtype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :keyword display_name: Display name of the label category. - :paramtype display_name: str - :keyword multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :paramtype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - super(LabelCategory, self).__init__(**kwargs) - self.classes = classes - self.display_name = display_name - self.multi_select = multi_select - - -class LabelClass(msrest.serialization.Model): - """Label class definition. - - :ivar display_name: Display name of the label class. - :vartype display_name: str - :ivar subclasses: Dictionary of subclasses of the label class. - :vartype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, - } - - def __init__( - self, - *, - display_name: Optional[str] = None, - subclasses: Optional[Dict[str, "LabelClass"]] = None, - **kwargs - ): - """ - :keyword display_name: Display name of the label class. - :paramtype display_name: str - :keyword subclasses: Dictionary of subclasses of the label class. - :paramtype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - super(LabelClass, self).__init__(**kwargs) - self.display_name = display_name - self.subclasses = subclasses - - -class LabelingDataConfiguration(msrest.serialization.Model): - """Labeling data configuration definition. - - :ivar data_id: Resource Id of the data asset to perform labeling. - :vartype data_id: str - :ivar incremental_data_refresh: Indicates whether to enable incremental data refresh. Possible - values include: "Enabled", "Disabled". - :vartype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - - _attribute_map = { - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'incremental_data_refresh': {'key': 'incrementalDataRefresh', 'type': 'str'}, - } - - def __init__( - self, - *, - data_id: Optional[str] = None, - incremental_data_refresh: Optional[Union[str, "IncrementalDataRefresh"]] = None, - **kwargs - ): - """ - :keyword data_id: Resource Id of the data asset to perform labeling. - :paramtype data_id: str - :keyword incremental_data_refresh: Indicates whether to enable incremental data refresh. - Possible values include: "Enabled", "Disabled". - :paramtype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - super(LabelingDataConfiguration, self).__init__(**kwargs) - self.data_id = data_id - self.incremental_data_refresh = incremental_data_refresh - - -class LabelingJob(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.LabelingJobProperties - """ - - _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': 'LabelingJobProperties'}, - } - - def __init__( - self, - *, - properties: "LabelingJobProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - super(LabelingJob, self).__init__(**kwargs) - self.properties = properties - - -class LabelingJobMediaProperties(msrest.serialization.Model): - """Properties of a labeling job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LabelingJobImageProperties, LabelingJobTextProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - } - - _subtype_map = { - 'media_type': {'Image': 'LabelingJobImageProperties', 'Text': 'LabelingJobTextProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(LabelingJobMediaProperties, self).__init__(**kwargs) - self.media_type = None # type: Optional[str] - - -class LabelingJobImageProperties(LabelingJobMediaProperties): - """Properties of a labeling job for image data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - *, - annotation_type: Optional[Union[str, "ImageAnnotationType"]] = None, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - super(LabelingJobImageProperties, self).__init__(**kwargs) - self.media_type = 'Image' # type: str - self.annotation_type = annotation_type - - -class LabelingJobInstructions(msrest.serialization.Model): - """Instructions for labeling job. - - :ivar uri: The link to a page with detailed labeling instructions for labelers. - :vartype uri: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: Optional[str] = None, - **kwargs - ): - """ - :keyword uri: The link to a page with detailed labeling instructions for labelers. - :paramtype uri: str - """ - super(LabelingJobInstructions, self).__init__(**kwargs) - self.uri = uri - - -class LabelingJobProperties(JobBaseProperties): - """Labeling 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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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 created_date_time: Created time of the job in UTC timezone. - :vartype created_date_time: ~datetime.datetime - :ivar data_configuration: Configuration of data used in the job. - :vartype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :ivar job_instructions: Labeling instructions of the job. - :vartype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :ivar label_categories: Label categories of the job. - :vartype label_categories: dict[str, ~azure.mgmt.machinelearningservices.models.LabelCategory] - :ivar labeling_job_media_properties: Media type specific properties in the job. - :vartype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :ivar ml_assist_configuration: Configuration of MLAssist feature in the job. - :vartype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - :ivar progress_metrics: Progress metrics of the job. - :vartype progress_metrics: ~azure.mgmt.machinelearningservices.models.ProgressMetrics - :ivar project_id: Internal id of the job(Previously called project). - :vartype project_id: str - :ivar provisioning_state: Specifies the labeling job provisioning state. Possible values - include: "Succeeded", "Failed", "Canceled", "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.JobProvisioningState - :ivar status_messages: Status messages of the job. - :vartype status_messages: list[~azure.mgmt.machinelearningservices.models.StatusMessage] - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'progress_metrics': {'readonly': True}, - 'project_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status_messages': {'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'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'data_configuration': {'key': 'dataConfiguration', 'type': 'LabelingDataConfiguration'}, - 'job_instructions': {'key': 'jobInstructions', 'type': 'LabelingJobInstructions'}, - 'label_categories': {'key': 'labelCategories', 'type': '{LabelCategory}'}, - 'labeling_job_media_properties': {'key': 'labelingJobMediaProperties', 'type': 'LabelingJobMediaProperties'}, - 'ml_assist_configuration': {'key': 'mlAssistConfiguration', 'type': 'MLAssistConfiguration'}, - 'progress_metrics': {'key': 'progressMetrics', 'type': 'ProgressMetrics'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status_messages': {'key': 'statusMessages', 'type': '[StatusMessage]'}, - } - - 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, - services: Optional[Dict[str, "JobService"]] = None, - data_configuration: Optional["LabelingDataConfiguration"] = None, - job_instructions: Optional["LabelingJobInstructions"] = None, - label_categories: Optional[Dict[str, "LabelCategory"]] = None, - labeling_job_media_properties: Optional["LabelingJobMediaProperties"] = None, - ml_assist_configuration: Optional["MLAssistConfiguration"] = 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 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_configuration: Configuration of data used in the job. - :paramtype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :keyword job_instructions: Labeling instructions of the job. - :paramtype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :keyword label_categories: Label categories of the job. - :paramtype label_categories: dict[str, - ~azure.mgmt.machinelearningservices.models.LabelCategory] - :keyword labeling_job_media_properties: Media type specific properties in the job. - :paramtype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :keyword ml_assist_configuration: Configuration of MLAssist feature in the job. - :paramtype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - """ - super(LabelingJobProperties, 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, services=services, **kwargs) - self.job_type = 'Labeling' # type: str - self.created_date_time = None - self.data_configuration = data_configuration - self.job_instructions = job_instructions - self.label_categories = label_categories - self.labeling_job_media_properties = labeling_job_media_properties - self.ml_assist_configuration = ml_assist_configuration - self.progress_metrics = None - self.project_id = None - self.provisioning_state = None - self.status_messages = None - - -class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of LabelingJob entities. - - :ivar next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type LabelingJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[LabelingJob]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["LabelingJob"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type LabelingJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - super(LabelingJobResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class LabelingJobTextProperties(LabelingJobMediaProperties): - """Properties of a labeling job for text data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - *, - annotation_type: Optional[Union[str, "TextAnnotationType"]] = None, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - super(LabelingJobTextProperties, self).__init__(**kwargs) - self.media_type = 'Text' # type: str - self.annotation_type = annotation_type - - -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 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, '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 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionManagedIdentity"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = credentials - - -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 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 - :ivar spark_ready: - :vartype spark_ready: bool - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'spark_ready': {'key': 'sparkReady', 'type': 'bool'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "ManagedNetworkStatus"]] = None, - spark_ready: Optional[bool] = None, - **kwargs - ): - """ - :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 - :keyword spark_ready: - :paramtype spark_ready: bool - """ - super(ManagedNetworkProvisionStatus, self).__init__(**kwargs) - self.status = status - self.spark_ready = spark_ready - - -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 - """ - - _validation = { - 'network_id': {'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'}, - } - - 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 - - -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 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 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'}, - '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, - 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 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, 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 MLAssistConfiguration(msrest.serialization.Model): - """Labeling MLAssist configuration definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLAssistConfigurationDisabled, MLAssistConfigurationEnabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - _subtype_map = { - 'ml_assist': {'Disabled': 'MLAssistConfigurationDisabled', 'Enabled': 'MLAssistConfigurationEnabled'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfiguration, self).__init__(**kwargs) - self.ml_assist = None # type: Optional[str] - - -class MLAssistConfigurationDisabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is disabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfigurationDisabled, self).__init__(**kwargs) - self.ml_assist = 'Disabled' # type: str - - -class MLAssistConfigurationEnabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is enabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - :ivar inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :vartype inferencing_compute_binding: str - :ivar training_compute_binding: Required. [Required] AML compute binding used in training. - :vartype training_compute_binding: str - """ - - _validation = { - 'ml_assist': {'required': True}, - 'inferencing_compute_binding': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_compute_binding': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - 'inferencing_compute_binding': {'key': 'inferencingComputeBinding', 'type': 'str'}, - 'training_compute_binding': {'key': 'trainingComputeBinding', 'type': 'str'}, - } - - def __init__( - self, - *, - inferencing_compute_binding: str, - training_compute_binding: str, - **kwargs - ): - """ - :keyword inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :paramtype inferencing_compute_binding: str - :keyword training_compute_binding: Required. [Required] AML compute binding used in training. - :paramtype training_compute_binding: str - """ - super(MLAssistConfigurationEnabled, self).__init__(**kwargs) - self.ml_assist = 'Enabled' # type: str - self.inferencing_compute_binding = inferencing_compute_binding - self.training_compute_binding = training_compute_binding - - -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, '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 asset_version: Output Asset Version. - :vartype asset_version: 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'}, - 'asset_version': {'key': 'assetVersion', '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, - asset_version: 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 asset_version: Output Asset Version. - :paramtype asset_version: 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, asset_version=asset_version, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - 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, '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, '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 asset_version: Output Asset Version. - :vartype asset_version: 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'}, - 'asset_version': {'key': 'assetVersion', '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, - asset_version: 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 asset_version: Output Asset Version. - :paramtype asset_version: 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, asset_version=asset_version, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.mode = mode - self.uri = uri - self.job_output_type = 'mltable' # type: str - self.description = description - - -class ModelContainer(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.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 ModelVersion(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.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 - """ - - _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'}, - } - - 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, - **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 - """ - 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 - - -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 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 NlpFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML NLP training. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: int - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: int - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: int - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: int - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: float - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: float - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'float'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - *, - gradient_accumulation_steps: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "NlpLearningRateScheduler"]] = None, - model_name: Optional[str] = None, - number_of_epochs: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_ratio: Optional[float] = None, - weight_decay: Optional[float] = None, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: int - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: int - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: int - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: int - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: float - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: float - """ - super(NlpFixedParameters, self).__init__(**kwargs) - self.gradient_accumulation_steps = gradient_accumulation_steps - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.number_of_epochs = number_of_epochs - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_ratio = warmup_ratio - self.weight_decay = weight_decay - - -class NlpParameterSubspace(msrest.serialization.Model): - """Stringified search spaces for each parameter. See below examples. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :vartype learning_rate_scheduler: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: str - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: str - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: str - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: str - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: str - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - *, - gradient_accumulation_steps: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - number_of_epochs: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_ratio: Optional[str] = None, - weight_decay: Optional[str] = None, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :paramtype learning_rate_scheduler: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: str - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: str - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: str - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: str - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: str - """ - super(NlpParameterSubspace, self).__init__(**kwargs) - self.gradient_accumulation_steps = gradient_accumulation_steps - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.number_of_epochs = number_of_epochs - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_ratio = warmup_ratio - self.weight_decay = weight_decay - - -class NlpSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter tuning related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. 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 for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(NlpSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.sampling_algorithm = sampling_algorithm - - -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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - } - - def __init__( - self, - *, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_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_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Timeout for individual HD trials. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_trials: Optional[int] = 1, - max_nodes: Optional[int] = 1, - max_trials: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "P7D", - trial_timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Timeout for individual HD trials. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = max_concurrent_trials - self.max_nodes = max_nodes - self.max_trials = max_trials - self.timeout = timeout - self.trial_timeout = trial_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. - - 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 - """ - - _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'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 - """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **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", "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 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 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 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: 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 OutboundRuleBasicResource(Resource): - """Outbound Rule Basic Resource 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 id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the 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 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] - :ivar next_link: The link to the next page constructed using the continuationToken. If null, - there are no additional pages. - :vartype next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OutboundRuleBasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["OutboundRuleBasicResource"]] = 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.OutboundRuleBasicResource] - :keyword next_link: The link to the next page constructed using the continuationToken. If - null, there are no additional pages. - :paramtype next_link: str - """ - super(OutboundRuleListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -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 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.PartialManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Additional attributes of the entity. - :vartype properties: any - :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'}, - 'properties': {'key': 'properties', 'type': 'object'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - identity: Optional["PartialManagedServiceIdentity"] = None, - kind: Optional[str] = None, - properties: Optional[Any] = 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 properties: Additional attributes of the entity. - :paramtype properties: any - :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.kind = kind - self.properties = properties - 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. - - 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionPersonalAccessToken"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = credentials - - -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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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 - :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'}, - '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, - 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 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, 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 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 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 - :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'}, - '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'}, - '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["ManagedServiceIdentity"] = 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.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 - :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.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 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 subresource_target: - :vartype subresource_target: str - :ivar spark_enabled: - :vartype spark_enabled: bool - :ivar spark_status: Status 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 - """ - - _attribute_map = { - 'service_resource_id': {'key': 'serviceResourceId', 'type': 'str'}, - 'subresource_target': {'key': 'subresourceTarget', 'type': 'str'}, - 'spark_enabled': {'key': 'sparkEnabled', 'type': 'bool'}, - 'spark_status': {'key': 'sparkStatus', 'type': 'str'}, - } - - def __init__( - self, - *, - service_resource_id: Optional[str] = None, - subresource_target: Optional[str] = None, - spark_enabled: Optional[bool] = None, - spark_status: Optional[Union[str, "RuleStatus"]] = None, - **kwargs - ): - """ - :keyword service_resource_id: - :paramtype service_resource_id: str - :keyword subresource_target: - :paramtype subresource_target: str - :keyword spark_enabled: - :paramtype spark_enabled: bool - :keyword spark_status: Status 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 - """ - super(PrivateEndpointDestination, self).__init__(**kwargs) - self.service_resource_id = service_resource_id - self.subresource_target = subresource_target - self.spark_enabled = spark_enabled - self.spark_status = spark_status - - -class PrivateEndpointOutboundRule(OutboundRule): - """Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :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 status: Status 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 category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :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 - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'PrivateEndpointDestination'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "RuleStatus"]] = None, - category: Optional[Union[str, "RuleCategory"]] = None, - destination: Optional["PrivateEndpointDestination"] = None, - **kwargs - ): - """ - :keyword status: Status 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 category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :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 - """ - super(PrivateEndpointOutboundRule, self).__init__(status=status, category=category, **kwargs) - self.type = 'PrivateEndpoint' # type: str - self.destination = destination - - -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: 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 - :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'}, - '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'}, - '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, - 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.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 - :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.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 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 ProgressMetrics(msrest.serialization.Model): - """Progress metrics definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar completed_datapoint_count: The completed datapoint count. - :vartype completed_datapoint_count: long - :ivar incremental_data_last_refresh_date_time: The time of last successful incremental data - refresh in UTC. - :vartype incremental_data_last_refresh_date_time: ~datetime.datetime - :ivar skipped_datapoint_count: The skipped datapoint count. - :vartype skipped_datapoint_count: long - :ivar total_datapoint_count: The total datapoint count. - :vartype total_datapoint_count: long - """ - - _validation = { - 'completed_datapoint_count': {'readonly': True}, - 'incremental_data_last_refresh_date_time': {'readonly': True}, - 'skipped_datapoint_count': {'readonly': True}, - 'total_datapoint_count': {'readonly': True}, - } - - _attribute_map = { - 'completed_datapoint_count': {'key': 'completedDatapointCount', 'type': 'long'}, - 'incremental_data_last_refresh_date_time': {'key': 'incrementalDataLastRefreshDateTime', 'type': 'iso-8601'}, - 'skipped_datapoint_count': {'key': 'skippedDatapointCount', 'type': 'long'}, - 'total_datapoint_count': {'key': 'totalDatapointCount', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProgressMetrics, self).__init__(**kwargs) - self.completed_datapoint_count = None - self.incremental_data_last_refresh_date_time = None - self.skipped_datapoint_count = None - self.total_datapoint_count = 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, - *, - 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 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 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 logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :vartype logbase: str - :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'}, - 'logbase': {'key': 'logbase', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, - } - - def __init__( - self, - *, - logbase: Optional[str] = None, - rule: Optional[Union[str, "RandomSamplingAlgorithmRule"]] = None, - seed: Optional[int] = None, - **kwargs - ): - """ - :keyword logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :paramtype logbase: str - :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.logbase = logbase - self.rule = rule - self.seed = seed - - -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 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 properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RegistryProperties - :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': 'RegistryProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - *, - location: str, - properties: "RegistryProperties", - 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.RegistryProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(Registry, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -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 RegistryProperties(ResourceBase): - """Details of the Registry. - - :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 public_network_access: - :vartype public_network_access: str - :ivar discovery_url: - :vartype discovery_url: str - :ivar intellectual_property_publisher: - :vartype intellectual_property_publisher: str - :ivar managed_resource_group: Managed resource group created for the registry. - :vartype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar ml_flow_registry_uri: - :vartype ml_flow_registry_uri: str - :ivar private_link_count: - :vartype private_link_count: int - :ivar region_details: Details of each region the registry is in. - :vartype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - :ivar managed_resource_group_tags: Tags to be applied to the managed resource group associated - with this registry. - :vartype managed_resource_group_tags: dict[str, str] - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'discovery_url': {'key': 'discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'managedResourceGroup', 'type': 'ArmResourceId'}, - 'ml_flow_registry_uri': {'key': 'mlFlowRegistryUri', 'type': 'str'}, - 'private_link_count': {'key': 'privateLinkCount', 'type': 'int'}, - 'region_details': {'key': 'regionDetails', 'type': '[RegistryRegionArmDetails]'}, - 'managed_resource_group_tags': {'key': 'managedResourceGroupTags', 'type': '{str}'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - public_network_access: Optional[str] = None, - discovery_url: Optional[str] = None, - intellectual_property_publisher: Optional[str] = None, - managed_resource_group: Optional["ArmResourceId"] = None, - ml_flow_registry_uri: Optional[str] = None, - private_link_count: Optional[int] = None, - region_details: Optional[List["RegistryRegionArmDetails"]] = None, - managed_resource_group_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 public_network_access: - :paramtype public_network_access: str - :keyword discovery_url: - :paramtype discovery_url: str - :keyword intellectual_property_publisher: - :paramtype intellectual_property_publisher: str - :keyword managed_resource_group: Managed resource group created for the registry. - :paramtype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword ml_flow_registry_uri: - :paramtype ml_flow_registry_uri: str - :keyword private_link_count: - :paramtype private_link_count: int - :keyword region_details: Details of each region the registry is in. - :paramtype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - :keyword managed_resource_group_tags: Tags to be applied to the managed resource group - associated with this registry. - :paramtype managed_resource_group_tags: dict[str, str] - """ - super(RegistryProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.public_network_access = public_network_access - self.discovery_url = discovery_url - self.intellectual_property_publisher = intellectual_property_publisher - self.managed_resource_group = managed_resource_group - self.ml_flow_registry_uri = ml_flow_registry_uri - self.private_link_count = private_link_count - self.region_details = region_details - self.managed_resource_group_tags = managed_resource_group_tags - - -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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, 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.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - '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, - training_mode: Optional[Union[str, "TrainingMode"]] = 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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, training_mode=training_mode, **kwargs) - self.allowed_training_algorithms = allowed_training_algorithms - self.blocked_training_algorithms = blocked_training_algorithms - - -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 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 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionSharedAccessSignature"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = credentials - - -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 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(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.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 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 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionServicePrincipal"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **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", "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 ServiceTagDestination(msrest.serialization.Model): - """Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. - - :ivar service_tag: - :vartype service_tag: str - :ivar protocol: - :vartype protocol: str - :ivar port_ranges: - :vartype port_ranges: str - """ - - _attribute_map = { - 'service_tag': {'key': 'serviceTag', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'port_ranges': {'key': 'portRanges', 'type': 'str'}, - } - - def __init__( - self, - *, - service_tag: Optional[str] = None, - protocol: Optional[str] = None, - port_ranges: Optional[str] = None, - **kwargs - ): - """ - :keyword service_tag: - :paramtype service_tag: str - :keyword protocol: - :paramtype protocol: str - :keyword port_ranges: - :paramtype port_ranges: str - """ - super(ServiceTagDestination, self).__init__(**kwargs) - self.service_tag = service_tag - self.protocol = protocol - self.port_ranges = port_ranges - - -class ServiceTagOutboundRule(OutboundRule): - """Service Tag Outbound Rule for the managed network of a machine learning workspace. - - All required parameters must be populated in order to send to Azure. - - :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 status: Status 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 category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :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 = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'ServiceTagDestination'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "RuleStatus"]] = None, - category: Optional[Union[str, "RuleCategory"]] = None, - destination: Optional["ServiceTagDestination"] = None, - **kwargs - ): - """ - :keyword status: Status 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 category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :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__(status=status, category=category, **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 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): - """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 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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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 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 resource 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 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 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, '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'}, - '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'}, - '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]'}, - '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, - 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, - 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, - 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 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 resource 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 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 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, 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.files = files - self.inputs = inputs - self.jars = jars - self.outputs = outputs - self.py_files = py_files - 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 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 StatusMessage(msrest.serialization.Model): - """Active message associated with project. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Service-defined message code. - :vartype code: str - :ivar created_date_time: Time in UTC at which the message was created. - :vartype created_date_time: ~datetime.datetime - :ivar level: Severity level of message. Possible values include: "Error", "Information", - "Warning". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.StatusMessageLevel - :ivar message: A human-readable representation of the message code. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(StatusMessage, self).__init__(**kwargs) - self.code = None - self.created_date_time = None - self.level = None - self.message = None - - -class StorageAccountDetails(msrest.serialization.Model): - """Details of storage account to be used for the Registry. - - :ivar system_created_storage_account: - :vartype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :ivar user_created_storage_account: - :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: - :paramtype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :keyword user_created_storage_account: - :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", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :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}'}, - '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'}, - '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, - 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, - 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 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 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, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, 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 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", "SoftDeleted". - :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_sku: - :vartype acr_account_sku: str - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - } - - def __init__( - self, - *, - acr_account_sku: Optional[str] = None, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs - ): - """ - :keyword acr_account_sku: - :paramtype acr_account_sku: str - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(SystemCreatedAcrAccount, self).__init__(**kwargs) - self.acr_account_sku = acr_account_sku - self.arm_resource_id = arm_resource_id - - -class SystemCreatedStorageAccount(msrest.serialization.Model): - """SystemCreatedStorageAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar storage_account_hns_enabled: - :vartype storage_account_hns_enabled: bool - :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 - :ivar allow_blob_public_access: - :vartype allow_blob_public_access: bool - """ - - _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - 'allow_blob_public_access': {'key': 'allowBlobPublicAccess', 'type': 'bool'}, - } - - def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - storage_account_hns_enabled: Optional[bool] = None, - storage_account_type: Optional[str] = None, - allow_blob_public_access: Optional[bool] = None, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword storage_account_hns_enabled: - :paramtype storage_account_hns_enabled: bool - :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 - :keyword allow_blob_public_access: - :paramtype allow_blob_public_access: bool - """ - super(SystemCreatedStorageAccount, self).__init__(**kwargs) - self.arm_resource_id = arm_resource_id - self.storage_account_hns_enabled = storage_account_hns_enabled - self.storage_account_type = storage_account_type - self.allow_blob_public_access = allow_blob_public_access - - -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 TableFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML Table training. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: int - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: int - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: int - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: int - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: float - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: int - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: int - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: float - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: float - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: float - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: float - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: bool - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: bool - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'max_bin': {'key': 'maxBin', 'type': 'int'}, - 'max_depth': {'key': 'maxDepth', 'type': 'int'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'int'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'int'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'float'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'int'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'int'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'float'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'float'}, - 'subsample': {'key': 'subsample', 'type': 'float'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'float'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'bool'}, - 'with_std': {'key': 'withStd', 'type': 'bool'}, - } - - def __init__( - self, - *, - booster: Optional[str] = None, - boosting_type: Optional[str] = None, - grow_policy: Optional[str] = None, - learning_rate: Optional[float] = None, - max_bin: Optional[int] = None, - max_depth: Optional[int] = None, - max_leaves: Optional[int] = None, - min_data_in_leaf: Optional[int] = None, - min_split_gain: Optional[float] = None, - model_name: Optional[str] = None, - n_estimators: Optional[int] = None, - num_leaves: Optional[int] = None, - preprocessor_name: Optional[str] = None, - reg_alpha: Optional[float] = None, - reg_lambda: Optional[float] = None, - subsample: Optional[float] = None, - subsample_freq: Optional[float] = None, - tree_method: Optional[str] = None, - with_mean: Optional[bool] = False, - with_std: Optional[bool] = False, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: int - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: int - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: int - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: int - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: float - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: int - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: int - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: float - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: float - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: float - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: float - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: bool - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: bool - """ - super(TableFixedParameters, self).__init__(**kwargs) - self.booster = booster - self.boosting_type = boosting_type - self.grow_policy = grow_policy - self.learning_rate = learning_rate - self.max_bin = max_bin - self.max_depth = max_depth - self.max_leaves = max_leaves - self.min_data_in_leaf = min_data_in_leaf - self.min_split_gain = min_split_gain - self.model_name = model_name - self.n_estimators = n_estimators - self.num_leaves = num_leaves - self.preprocessor_name = preprocessor_name - self.reg_alpha = reg_alpha - self.reg_lambda = reg_lambda - self.subsample = subsample - self.subsample_freq = subsample_freq - self.tree_method = tree_method - self.with_mean = with_mean - self.with_std = with_std - - -class TableParameterSubspace(msrest.serialization.Model): - """TableParameterSubspace. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: str - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: str - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: str - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: str - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: str - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: str - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: str - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: str - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: str - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: str - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: str - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: str - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'max_bin': {'key': 'maxBin', 'type': 'str'}, - 'max_depth': {'key': 'maxDepth', 'type': 'str'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'str'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'str'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'str'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'str'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'str'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'str'}, - 'subsample': {'key': 'subsample', 'type': 'str'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'str'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'str'}, - 'with_std': {'key': 'withStd', 'type': 'str'}, - } - - def __init__( - self, - *, - booster: Optional[str] = None, - boosting_type: Optional[str] = None, - grow_policy: Optional[str] = None, - learning_rate: Optional[str] = None, - max_bin: Optional[str] = None, - max_depth: Optional[str] = None, - max_leaves: Optional[str] = None, - min_data_in_leaf: Optional[str] = None, - min_split_gain: Optional[str] = None, - model_name: Optional[str] = None, - n_estimators: Optional[str] = None, - num_leaves: Optional[str] = None, - preprocessor_name: Optional[str] = None, - reg_alpha: Optional[str] = None, - reg_lambda: Optional[str] = None, - subsample: Optional[str] = None, - subsample_freq: Optional[str] = None, - tree_method: Optional[str] = None, - with_mean: Optional[str] = None, - with_std: Optional[str] = None, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: str - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: str - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: str - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: str - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: str - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: str - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: str - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: str - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: str - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: str - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: str - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: str - """ - super(TableParameterSubspace, self).__init__(**kwargs) - self.booster = booster - self.boosting_type = boosting_type - self.grow_policy = grow_policy - self.learning_rate = learning_rate - self.max_bin = max_bin - self.max_depth = max_depth - self.max_leaves = max_leaves - self.min_data_in_leaf = min_data_in_leaf - self.min_split_gain = min_split_gain - self.model_name = model_name - self.n_estimators = n_estimators - self.num_leaves = num_leaves - self.preprocessor_name = preprocessor_name - self.reg_alpha = reg_alpha - self.reg_lambda = reg_lambda - self.subsample = subsample - self.subsample_freq = subsample_freq - self.tree_method = tree_method - self.with_mean = with_mean - self.with_std = with_std - - -class TableSweepSettings(msrest.serialization.Model): - """TableSweepSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. 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 for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(TableSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.sampling_algorithm = sampling_algorithm - - -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_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of iterations. - :vartype max_trials: int - :ivar sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to trigger. - :vartype sweep_concurrent_trials: int - :ivar sweep_trials: Number of sweeping runs that user wants to trigger. - :vartype sweep_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_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'sweep_concurrent_trials': {'key': 'sweepConcurrentTrials', 'type': 'int'}, - 'sweep_trials': {'key': 'sweepTrials', '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_nodes: Optional[int] = 1, - max_trials: Optional[int] = 1000, - sweep_concurrent_trials: Optional[int] = 0, - sweep_trials: Optional[int] = 0, - 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_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of iterations. - :paramtype max_trials: int - :keyword sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to - trigger. - :paramtype sweep_concurrent_trials: int - :keyword sweep_trials: Number of sweeping runs that user wants to trigger. - :paramtype sweep_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_nodes = max_nodes - self.max_trials = max_trials - self.sweep_concurrent_trials = sweep_concurrent_trials - self.sweep_trials = sweep_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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - '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, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - '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, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - '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, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_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 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, '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, '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 asset_version: Output Asset Version. - :vartype asset_version: 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'}, - 'asset_version': {'key': 'assetVersion', '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, - asset_version: 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 asset_version: Output Asset Version. - :paramtype asset_version: 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, asset_version=asset_version, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - 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, '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, '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 asset_version: Output Asset Version. - :vartype asset_version: 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'}, - 'asset_version': {'key': 'assetVersion', '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, - asset_version: 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 asset_version: Output Asset Version. - :paramtype asset_version: 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, asset_version=asset_version, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - 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, '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, '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 asset_version: Output Asset Version. - :vartype asset_version: 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'}, - 'asset_version': {'key': 'assetVersion', '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, - asset_version: 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 asset_version: Output Asset Version. - :paramtype asset_version: 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, asset_version=asset_version, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - 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. - - 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - - _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'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionUsernamePassword"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "AzureDataLakeGen2", "Redis". - :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 credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **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", "SoftDeleted". - :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: 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 - :ivar kind: - :vartype kind: str - :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. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. - :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", - "SoftDeleted". - :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 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 - :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 soft_deleted_at: The timestamp when the workspace was soft deleted. - :vartype soft_deleted_at: str - :ivar scheduled_purge_date: The timestamp when the soft deleted workspace is going to be - purged. - :vartype scheduled_purge_date: str - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :vartype system_datastores_auth_mode: str - :ivar feature_store_settings: Settings for feature store type workspace. - :vartype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :ivar managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - """ - - _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}, - 'soft_deleted_at': {'readonly': True}, - 'scheduled_purge_date': {'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'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'str'}, - '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'}, - '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'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'soft_deleted_at': {'key': 'properties.softDeletedAt', 'type': 'str'}, - 'scheduled_purge_date': {'key': 'properties.scheduledPurgeDate', 'type': 'str'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - sku: Optional["Sku"] = None, - kind: Optional[str] = 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, - 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, - v1_legacy_mode: Optional[bool] = False, - system_datastores_auth_mode: Optional[str] = None, - feature_store_settings: Optional["FeatureStoreSettings"] = None, - managed_network: Optional["ManagedNetworkSettings"] = None, - **kwargs - ): - """ - :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 - :keyword kind: - :paramtype kind: str - :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. - :paramtype application_insights: str - :keyword container_registry: ARM id of the container registry associated with this workspace. - :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 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 - :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 system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :paramtype system_datastores_auth_mode: str - :keyword feature_store_settings: Settings for feature store type workspace. - :paramtype feature_store_settings: - ~azure.mgmt.machinelearningservices.models.FeatureStoreSettings - :keyword managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - """ - super(Workspace, self).__init__(**kwargs) - self.identity = identity - self.location = location - self.tags = tags - self.sku = sku - self.kind = kind - 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.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 - self.v1_legacy_mode = v1_legacy_mode - self.soft_deleted_at = None - self.scheduled_purge_date = None - self.system_datastores_auth_mode = system_datastores_auth_mode - self.feature_store_settings = feature_store_settings - self.managed_network = managed_network - - -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 WorkspaceConnectionManagedIdentity(msrest.serialization.Model): - """WorkspaceConnectionManagedIdentity. - - :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(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.resource_id = resource_id - self.client_id = client_id - - -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. - - 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 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 WorkspaceConnectionUsernamePassword(msrest.serialization.Model): - """WorkspaceConnectionUsernamePassword. - - :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(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.username = username - self.password = password - - -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.ManagedServiceIdentity - :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 - :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 encryption: The encryption settings of the workspace. - :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 managed_network: Managed Network settings for a machine learning workspace. - :vartype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - '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'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionUpdateProperties'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - sku: Optional["Sku"] = None, - identity: Optional["ManagedServiceIdentity"] = 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, - application_insights: Optional[str] = None, - container_registry: Optional[str] = None, - encryption: Optional["EncryptionUpdateProperties"] = None, - feature_store_settings: Optional["FeatureStoreSettings"] = None, - managed_network: Optional["ManagedNetworkSettings"] = 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.ManagedServiceIdentity - :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 - :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 encryption: The encryption settings of the workspace. - :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 managed_network: Managed Network settings for a machine learning workspace. - :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings - """ - 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 - self.application_insights = application_insights - self.container_registry = container_registry - self.encryption = encryption - self.feature_store_settings = feature_store_settings - self.managed_network = managed_network diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/__init__.py deleted file mode 100644 index 3591226dc04e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/__init__.py +++ /dev/null @@ -1,89 +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 ._managed_network_settings_rule_operations import ManagedNetworkSettingsRuleOperations -from ._managed_network_provisions_operations import ManagedNetworkProvisionsOperations -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_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 ._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 ._labeling_jobs_operations import LabelingJobsOperations -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 - -__all__ = [ - 'Operations', - 'WorkspacesOperations', - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'WorkspaceConnectionsOperations', - 'ManagedNetworkSettingsRuleOperations', - 'ManagedNetworkProvisionsOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'JobsOperations', - 'LabelingJobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_batch_deployments_operations.py deleted file mode 100644 index cc371e34fc1b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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', "2022-12-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', "2022-12-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, **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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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, **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/v2022_12_01_preview/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_batch_endpoints_operations.py deleted file mode 100644 index 0f6be031da72..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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', "2022-12-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', "2022-12-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, **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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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, **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', "2022-12-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/v2022_12_01_preview/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_code_containers_operations.py deleted file mode 100644 index b870e79ef42c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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/v2022_12_01_preview/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_code_versions_operations.py deleted file mode 100644 index b45078e91820..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_code_versions_operations.py +++ /dev/null @@ -1,552 +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 - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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}/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'), - "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 = kwargs.pop('api_version', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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 - """ - api_version = kwargs.pop('api_version', "2022-12-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, - 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, - 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', "2022-12-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', "2022-12-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', "2022-12-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_component_containers_operations.py deleted file mode 100644 index 71ed5b6886f2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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/v2022_12_01_preview/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_component_versions_operations.py deleted file mode 100644 index 7b6d7b61a964..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_component_versions_operations.py +++ /dev/null @@ -1,560 +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 - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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 - """ - api_version = kwargs.pop('api_version', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_compute_operations.py deleted file mode 100644 index 16bb1f63d3c6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_compute_operations.py +++ /dev/null @@ -1,1718 +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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-12-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'), - "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 - api_version = kwargs.pop('api_version', "2022-12-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'), - "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 - api_version = kwargs.pop('api_version', "2022-12-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'), - "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 - api_version = kwargs.pop('api_version', "2022-12-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'), - "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_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', "2022-12-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'), - "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="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', "2022-12-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'), - "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 = kwargs.pop('api_version', "2022-12-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'), - "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 = kwargs.pop('api_version', "2022-12-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'), - "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 = kwargs.pop('api_version', "2022-12-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'), - "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 = kwargs.pop('api_version', "2022-12-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'), - "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_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', "2022-12-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'), - "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="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 - """ - api_version = kwargs.pop('api_version', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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 - - - 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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_data_containers_operations.py deleted file mode 100644 index 70e469b153eb..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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/v2022_12_01_preview/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_data_versions_operations.py deleted file mode 100644 index 8ae5528ce3fc..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_data_versions_operations.py +++ /dev/null @@ -1,572 +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 - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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 - """ - api_version = kwargs.pop('api_version', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_datastores_operations.py deleted file mode 100644 index 7c74ee2bc6a8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_datastores_operations.py +++ /dev/null @@ -1,671 +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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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}/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'), - "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 - """ - api_version = kwargs.pop('api_version', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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 - **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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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, - name=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('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_12_01_preview/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_environment_containers_operations.py deleted file mode 100644 index db6606ef014b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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/v2022_12_01_preview/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_environment_versions_operations.py deleted file mode 100644 index 84a7e94dbd12..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_environment_versions_operations.py +++ /dev/null @@ -1,560 +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 - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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 - """ - api_version = kwargs.pop('api_version', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_jobs_operations.py deleted file mode 100644 index 6559d57464af..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_jobs_operations.py +++ /dev/null @@ -1,771 +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', "2022-12-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"]] - scheduled = kwargs.pop('scheduled', None) # type: Optional[bool] - schedule_id = kwargs.pop('schedule_id', 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'), - } - - _url = _format_url_section(_url, **path_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 = kwargs.pop('api_version', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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 - """ - api_version = kwargs.pop('api_version', "2022-12-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, - 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, - api_version=api_version, - 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( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=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', "2022-12-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', "2022-12-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, **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', "2022-12-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. - - 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.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', "2022-12-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', "2022-12-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', "2022-12-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/v2022_12_01_preview/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_labeling_jobs_operations.py deleted file mode 100644 index b8245907ca89..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_labeling_jobs_operations.py +++ /dev/null @@ -1,1044 +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', "2022-12-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "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 top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, '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_delete_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', "2022-12-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{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'), - "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', "2022-12-01-preview") # type: str - include_job_instructions = kwargs.pop('include_job_instructions', False) # type: Optional[bool] - include_label_categories = kwargs.pop('include_label_categories', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{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'), - "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') - if include_job_instructions is not None: - _query_parameters['includeJobInstructions'] = _SERIALIZER.query("include_job_instructions", include_job_instructions, 'bool') - if include_label_categories is not None: - _query_parameters['includeLabelCategories'] = _SERIALIZER.query("include_label_categories", include_label_categories, '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_create_or_update_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', "2022-12-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}/labelingJobs/{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'), - "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_export_labels_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', "2022-12-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}/labelingJobs/{id}/exportLabels") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "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] - 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_pause_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', "2022-12-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "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 - ) - - -def build_resume_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', "2022-12-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "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 LabelingJobsOperations(object): - """LabelingJobsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration 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] - top=None, # type: Optional[int] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.LabelingJobResourceArmPaginatedResult"] - """Lists labeling jobs in the workspace. - - Lists labeling 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 top: Number of labeling jobs to return. - :type top: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LabelingJobResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 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, - top=top, - 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, - top=top, - 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("LabelingJobResourceArmPaginatedResult", 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}/labelingJobs"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete a labeling job. - - Delete a labeling 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 LabelingJob. - :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', {})) - - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - - - request = build_delete_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.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}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - include_job_instructions=False, # type: Optional[bool] - include_label_categories=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> "_models.LabelingJob" - """Gets a labeling job by name/id. - - Gets a labeling 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 LabelingJob. - :type id: str - :param include_job_instructions: Boolean value to indicate whether to include JobInstructions - in response. - :type include_job_instructions: bool - :param include_label_categories: Boolean value to indicate Whether to include LabelCategories - in response. - :type include_label_categories: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LabelingJob, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJob - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2022-12-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, - include_job_instructions=include_job_instructions, - include_label_categories=include_label_categories, - 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('LabelingJob', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.LabelingJob" - **kwargs # type: Any - ): - # type: (...) -> "_models.LabelingJob" - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'LabelingJob') - - request = build_create_or_update_request_initial( - 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_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('LabelingJob', 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('LabelingJob', 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}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.LabelingJob" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.LabelingJob"] - """Creates or updates a labeling job (asynchronous). - - Creates or updates a labeling 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 LabelingJob. - :type id: str - :param body: LabelingJob definition object. - :type body: ~azure.mgmt.machinelearningservices.models.LabelingJob - :keyword callable cls: A custom type or function that will be passed the direct response - :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 LabelingJob or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2022-12-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.LabelingJob"] - lro_delay = kwargs.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, - id=id, - 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('LabelingJob', 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}/labelingJobs/{id}"} # type: ignore - - def _export_labels_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.ExportSummary" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ExportSummary"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExportSummary"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ExportSummary') - - request = build_export_labels_request_initial( - 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._export_labels_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('ExportSummary', 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 - - _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - - @distributed_trace - def begin_export_labels( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.ExportSummary" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ExportSummary"] - """Export labels from a labeling job (asynchronous). - - Export labels from a labeling 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 LabelingJob. - :type id: str - :param body: The export summary. - :type body: ~azure.mgmt.machinelearningservices.models.ExportSummary - :keyword callable cls: A custom type or function that will be passed the direct response - :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 ExportSummary or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2022-12-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.ExportSummary"] - lro_delay = kwargs.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._export_labels_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - 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('ExportSummary', 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_export_labels.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - @distributed_trace - def pause( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Pause a labeling job. - - Pause a labeling 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 LabelingJob. - :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', {})) - - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - - - request = build_pause_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.pause.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, 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, {}) - - pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - - - def _resume_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', "2022-12-01-preview") # type: str - - - request = build_resume_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._resume_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) - - _resume_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore - - - @distributed_trace - def begin_resume( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Resume a labeling job (asynchronous). - - Resume a labeling 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 LabelingJob. - :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', "2022-12-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._resume_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_resume.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_managed_network_provisions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_managed_network_provisions_operations.py deleted file mode 100644 index df41457acccb..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_managed_network_provisions_operations.py +++ /dev/null @@ -1,231 +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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[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 - parameters=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', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if parameters is not None: - _json = self._serialize.body(parameters, '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')) - - - 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 - parameters=None, # type: Optional["_models.ManagedNetworkProvisionOptions"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ManagedNetworkProvisionStatus"] - """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: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param parameters: Managed Network Provisioning Options for a machine learning workspace. - :type parameters: ~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', "2022-12-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, - 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('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/v2022_12_01_preview/operations/_managed_network_settings_rule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_managed_network_settings_rule_operations.py deleted file mode 100644 index cc1ca26d209c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_managed_network_settings_rule_operations.py +++ /dev/null @@ -1,619 +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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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. - - :param resource_group_name: The name of the resource 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 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', "2022-12-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', "2022-12-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')) - - - 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. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :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', "2022-12-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. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :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', "2022-12-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 - parameters, # 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', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, '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')) - - - 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 - parameters, # 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. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param workspace_name: Name of Azure Machine Learning workspace. - :type workspace_name: str - :param rule_name: Name of the workspace managed network outbound rule. - :type rule_name: str - :param parameters: Outbound Rule to be created or updated in the managed network of a machine - learning workspace. - :type parameters: ~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', "2022-12-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, - 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('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/v2022_12_01_preview/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_model_containers_operations.py deleted file mode 100644 index 9cc54fe75439..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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/v2022_12_01_preview/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_model_versions_operations.py deleted file mode 100644 index ff48e496c9fd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_model_versions_operations.py +++ /dev/null @@ -1,610 +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 - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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 - """ - api_version = kwargs.pop('api_version', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_online_deployments_operations.py deleted file mode 100644 index d8d4dc51ad19..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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', "2022-12-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', "2022-12-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, **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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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, **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', "2022-12-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', "2022-12-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/v2022_12_01_preview/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_online_endpoints_operations.py deleted file mode 100644 index e4ed20f11274..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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', "2022-12-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', "2022-12-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, **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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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, **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', "2022-12-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', "2022-12-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', "2022-12-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 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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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/v2022_12_01_preview/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_operations.py deleted file mode 100644 index a0384e6de08d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_operations.py +++ /dev/null @@ -1,154 +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', "2022-12-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.AmlOperationListResult"] - """Lists all of the available Azure Machine Learning Services 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 AmlOperationListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlOperationListResult"] - error_map = { - 401: ClientAuthenticationError, 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("AmlOperationListResult", 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/v2022_12_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index bfd90aef963b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_private_endpoint_connections_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 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( - resource_group_name, # type: str - workspace_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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 = { - "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 = kwargs.pop('api_version', "2022-12-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'), - "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', "2022-12-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'), - "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 = kwargs.pop('api_version', "2022-12-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'), - "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 - """ - api_version = kwargs.pop('api_version', "2022-12-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( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - 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) - - else: - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - 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("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 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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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 - 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', {})) - - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - 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, - 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 - - - @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 - """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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_private_link_resources_operations.py deleted file mode 100644 index fac16cf8a162..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,150 +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( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', {})) - - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - - - 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) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, 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_12_01_preview/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_quotas_operations.py deleted file mode 100644 index 23294259cba4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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', "2022-12-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', "2022-12-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', "2022-12-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/v2022_12_01_preview/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registries_operations.py deleted file mode 100644 index 7960e9ed5e68..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registries_operations.py +++ /dev/null @@ -1,895 +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', "2022-12-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/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') - 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 - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("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_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', "2022-12-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\-_]{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 - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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 - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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\-_]{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 - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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\-_]{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 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, - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RegistryTrackedResourceArmPaginatedResult"] - """List registries by subscription. - - List registries by 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 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', "2022-12-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, - 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, - 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("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 - skip=None, # type: Optional[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 - :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 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', "2022-12-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, - 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, - 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("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', "2022-12-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 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', "2022-12-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 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', "2022-12-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 - - - def _update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.PartialRegistryPartialTrackedResource" - **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', "2022-12-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_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._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize('Registry', 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')) - - deserialized = self._deserialize('Registry', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.PartialRegistryPartialTrackedResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_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 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 - :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', "2022-12-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._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': '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_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: (...) -> 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', "2022-12-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, 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('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 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', "2022-12-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_code_containers_operations.py deleted file mode 100644 index 5397008875f2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-12-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'), - "codeName": _SERIALIZER.url("code_name", code_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 - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - "codeName": _SERIALIZER.url("code_name", code_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 - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - "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. - :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', "2022-12-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', "2022-12-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 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. - :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', "2022-12-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 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. - :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', "2022-12-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', "2022-12-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 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. - :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', "2022-12-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/v2022_12_01_preview/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_code_versions_operations.py deleted file mode 100644 index 00e966ae0762..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_code_versions_operations.py +++ /dev/null @@ -1,681 +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', "2022-12-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'), - "codeName": _SERIALIZER.url("code_name", code_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 - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - "codeName": _SERIALIZER.url("code_name", code_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 - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - "codeName": _SERIALIZER.url("code_name", code_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 - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - "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 - ) - -# 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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_component_containers_operations.py deleted file mode 100644 index 38c1e8af22ab..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-12-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'), - "componentName": _SERIALIZER.url("component_name", component_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 - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - "componentName": _SERIALIZER.url("component_name", component_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 - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - "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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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/v2022_12_01_preview/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_component_versions_operations.py deleted file mode 100644 index 5962470e0b7f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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'), - "componentName": _SERIALIZER.url("component_name", component_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 - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - "componentName": _SERIALIZER.url("component_name", component_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 - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - "componentName": _SERIALIZER.url("component_name", component_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 - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - "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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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/v2022_12_01_preview/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_environment_containers_operations.py deleted file mode 100644 index 08c96ac6156f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-12-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'), - "environmentName": _SERIALIZER.url("environment_name", environment_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 - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - "environmentName": _SERIALIZER.url("environment_name", environment_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 - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - "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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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/v2022_12_01_preview/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_environment_versions_operations.py deleted file mode 100644 index b5264eee503b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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'), - "environmentName": _SERIALIZER.url("environment_name", environment_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_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', "2022-12-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'), - "environmentName": _SERIALIZER.url("environment_name", environment_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 - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - "environmentName": _SERIALIZER.url("environment_name", environment_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 - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - "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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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/v2022_12_01_preview/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_model_containers_operations.py deleted file mode 100644 index 3748199a1e16..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-12-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'), - "modelName": _SERIALIZER.url("model_name", model_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 - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - "modelName": _SERIALIZER.url("model_name", model_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 - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - "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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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/v2022_12_01_preview/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_model_versions_operations.py deleted file mode 100644 index 4c257922f711..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_model_versions_operations.py +++ /dev/null @@ -1,723 +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', "2022-12-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'), - "modelName": _SERIALIZER.url("model_name", model_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 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', "2022-12-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'), - "modelName": _SERIALIZER.url("model_name", model_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 - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - "modelName": _SERIALIZER.url("model_name", model_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 - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2022-12-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'), - "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 - ) - -# 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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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. - :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', "2022-12-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', "2022-12-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. - :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', "2022-12-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_schedules_operations.py deleted file mode 100644 index 8da8f3baffe2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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'), - "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', "2022-12-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', "2022-12-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', "2022-12-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, **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', "2022-12-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', "2022-12-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', "2022-12-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, **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/v2022_12_01_preview/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_usages_operations.py deleted file mode 100644 index a638b0da2621..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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', "2022-12-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/v2022_12_01_preview/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_virtual_machine_sizes_operations.py deleted file mode 100644 index 0824521a8134..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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', "2022-12-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/v2022_12_01_preview/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_workspace_connections_operations.py deleted file mode 100644 index 826d58aebf78..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_workspace_connections_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 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_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', "2022-12-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'), - "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 = kwargs.pop('api_version', "2022-12-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'), - "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 = kwargs.pop('api_version', "2022-12-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'), - "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 - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - target = kwargs.pop('target', None) # type: Optional[str] - category = kwargs.pop('category', None) # type: Optional[str] - - 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'), - } - - _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', {})) - - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - 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, - 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 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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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 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. - - :param resource_group_name: The name of the resource group. 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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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 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 - """ - api_version = kwargs.pop('api_version', "2022-12-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, - 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, - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_workspace_features_operations.py deleted file mode 100644 index 65193f985379..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', "2022-12-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/v2022_12_01_preview/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_workspaces_operations.py deleted file mode 100644 index 6811104c993c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_workspaces_operations.py +++ /dev/null @@ -1,1832 +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_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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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 - api_version = kwargs.pop('api_version', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[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 = kwargs.pop('api_version', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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 - api_version = kwargs.pop('api_version', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[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 - api_version = kwargs.pop('api_version', "2022-12-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") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("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 - api_version = kwargs.pop('api_version', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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 - api_version = kwargs.pop('api_version', "2022-12-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/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 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 = kwargs.pop('api_version', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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 = kwargs.pop('api_version', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', "2022-12-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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 _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', {})) - - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - 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, - 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 - 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 - """ - api_version = kwargs.pop('api_version', "2022-12-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, - 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('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_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - def _delete_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', "2022-12-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, - 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) - - 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( # pylint: disable=inconsistent-return-statements - 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 - """ - api_version = kwargs.pop('api_version', "2022-12-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, - 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}"} # 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', {})) - - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - 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, - 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 - 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 - """ - api_version = kwargs.pop('api_version', "2022-12-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, - 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('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 - - @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 - """ - api_version = kwargs.pop('api_version', "2022-12-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, - 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, - 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("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 _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', {})) - - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - 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, - 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 - 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 - """ - api_version = kwargs.pop('api_version', "2022-12-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, - 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('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. - - :param resource_group_name: The name of the resource 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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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 - - - 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', "2022-12-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) - - 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( # 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. - - :param resource_group_name: The name of the resource 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 - """ - api_version = kwargs.pop('api_version', "2022-12-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, **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 - - @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 - """ - api_version = kwargs.pop('api_version', "2022-12-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, - 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, - 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("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_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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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 - - - 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', "2022-12-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 - 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 - """ - api_version = kwargs.pop('api_version', "2022-12-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 - - @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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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_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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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_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', {})) - - api_version = kwargs.pop('api_version', "2022-12-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/py.typed b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_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/_restclient/v2023_02_01_preview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/__init__.py deleted file mode 100644 index 71cf8fdc020d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/__init__.py +++ /dev/null @@ -1,19 +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/v2023_02_01_preview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_azure_machine_learning_workspaces.py deleted file mode 100644 index 88e7a536f27e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,357 +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, - DataContainersOperations, - DataVersionsOperations, - DatastoresOperations, - EnvironmentContainersOperations, - EnvironmentVersionsOperations, - FeaturesetContainersOperations, - FeaturesetVersionsOperations, - FeaturestoreEntityContainersOperations, - FeaturestoreEntityVersionsOperations, - JobsOperations, - LabelingJobsOperations, - ModelContainersOperations, - ModelVersionsOperations, - OnlineDeploymentsOperations, - OnlineEndpointsOperations, - Operations, - PrivateEndpointConnectionsOperations, - PrivateLinkResourcesOperations, - QuotasOperations, - RegistriesOperations, - RegistryCodeContainersOperations, - RegistryCodeVersionsOperations, - RegistryComponentContainersOperations, - RegistryComponentVersionsOperations, - RegistryDataContainersOperations, - RegistryDataVersionsOperations, - RegistryEnvironmentContainersOperations, - RegistryEnvironmentVersionsOperations, - RegistryModelContainersOperations, - RegistryModelVersionsOperations, - SchedulesOperations, - 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 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 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_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 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 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 labeling_jobs: LabelingJobsOperations operations - :vartype labeling_jobs: azure.mgmt.machinelearningservices.operations.LabelingJobsOperations - :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 - :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 "2023-02-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.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.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_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.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.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.labeling_jobs = LabelingJobsOperations(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) - - 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/v2023_02_01_preview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_configuration.py deleted file mode 100644 index ac5b8a998405..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_configuration.py +++ /dev/null @@ -1,77 +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 "2023-02-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", "2023-02-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/v2023_02_01_preview/_metadata.json b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_metadata.json deleted file mode 100644 index 6a3d36f6df82..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_metadata.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "chosen_version": "2023-02-01-preview", - "total_api_version_list": ["2023-02-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", - "registries": "RegistriesOperations", - "workspace_features": "WorkspaceFeaturesOperations", - "registry_code_containers": "RegistryCodeContainersOperations", - "registry_code_versions": "RegistryCodeVersionsOperations", - "registry_component_containers": "RegistryComponentContainersOperations", - "registry_component_versions": "RegistryComponentVersionsOperations", - "registry_data_containers": "RegistryDataContainersOperations", - "registry_data_versions": "RegistryDataVersionsOperations", - "registry_environment_containers": "RegistryEnvironmentContainersOperations", - "registry_environment_versions": "RegistryEnvironmentVersionsOperations", - "registry_model_containers": "RegistryModelContainersOperations", - "registry_model_versions": "RegistryModelVersionsOperations", - "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", - "featureset_containers": "FeaturesetContainersOperations", - "featureset_versions": "FeaturesetVersionsOperations", - "featurestore_entity_containers": "FeaturestoreEntityContainersOperations", - "featurestore_entity_versions": "FeaturestoreEntityVersionsOperations", - "jobs": "JobsOperations", - "labeling_jobs": "LabelingJobsOperations", - "model_containers": "ModelContainersOperations", - "model_versions": "ModelVersionsOperations", - "online_endpoints": "OnlineEndpointsOperations", - "online_deployments": "OnlineDeploymentsOperations", - "schedules": "SchedulesOperations" - } -} diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_patch.py deleted file mode 100644 index f99e77fef986..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_vendor.py deleted file mode 100644 index 9aad73fc743e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_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/v2023_02_01_preview/_version.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_version.py deleted file mode 100644 index eae7c95b6fbd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_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/v2023_02_01_preview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/__init__.py deleted file mode 100644 index b90ec7485f14..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/__init__.py +++ /dev/null @@ -1,17 +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/v2023_02_01_preview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/_azure_machine_learning_workspaces.py deleted file mode 100644 index af1d827b7dd5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,350 +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, - DataContainersOperations, - DataVersionsOperations, - DatastoresOperations, - EnvironmentContainersOperations, - EnvironmentVersionsOperations, - FeaturesetContainersOperations, - FeaturesetVersionsOperations, - FeaturestoreEntityContainersOperations, - FeaturestoreEntityVersionsOperations, - JobsOperations, - LabelingJobsOperations, - ModelContainersOperations, - ModelVersionsOperations, - OnlineDeploymentsOperations, - OnlineEndpointsOperations, - Operations, - PrivateEndpointConnectionsOperations, - PrivateLinkResourcesOperations, - QuotasOperations, - RegistriesOperations, - RegistryCodeContainersOperations, - RegistryCodeVersionsOperations, - RegistryComponentContainersOperations, - RegistryComponentVersionsOperations, - RegistryDataContainersOperations, - RegistryDataVersionsOperations, - RegistryEnvironmentContainersOperations, - RegistryEnvironmentVersionsOperations, - RegistryModelContainersOperations, - RegistryModelVersionsOperations, - SchedulesOperations, - 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 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 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_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 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 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 labeling_jobs: LabelingJobsOperations operations - :vartype labeling_jobs: - azure.mgmt.machinelearningservices.aio.operations.LabelingJobsOperations - :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 - :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 "2023-02-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.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.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_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.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.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.labeling_jobs = LabelingJobsOperations(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) - - 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/v2023_02_01_preview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/_configuration.py deleted file mode 100644 index 4404dd346232..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/_configuration.py +++ /dev/null @@ -1,66 +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 "2023-02-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", "2023-02-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/v2023_02_01_preview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/_patch.py deleted file mode 100644 index f99e77fef986..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/__init__.py deleted file mode 100644 index cbd930017658..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/__init__.py +++ /dev/null @@ -1,97 +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 ._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_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 ._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 ._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 ._labeling_jobs_operations import LabelingJobsOperations -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 - -__all__ = [ - "Operations", - "WorkspacesOperations", - "UsagesOperations", - "VirtualMachineSizesOperations", - "QuotasOperations", - "ComputeOperations", - "PrivateEndpointConnectionsOperations", - "PrivateLinkResourcesOperations", - "WorkspaceConnectionsOperations", - "RegistriesOperations", - "WorkspaceFeaturesOperations", - "RegistryCodeContainersOperations", - "RegistryCodeVersionsOperations", - "RegistryComponentContainersOperations", - "RegistryComponentVersionsOperations", - "RegistryDataContainersOperations", - "RegistryDataVersionsOperations", - "RegistryEnvironmentContainersOperations", - "RegistryEnvironmentVersionsOperations", - "RegistryModelContainersOperations", - "RegistryModelVersionsOperations", - "BatchEndpointsOperations", - "BatchDeploymentsOperations", - "CodeContainersOperations", - "CodeVersionsOperations", - "ComponentContainersOperations", - "ComponentVersionsOperations", - "DataContainersOperations", - "DataVersionsOperations", - "DatastoresOperations", - "EnvironmentContainersOperations", - "EnvironmentVersionsOperations", - "FeaturesetContainersOperations", - "FeaturesetVersionsOperations", - "FeaturestoreEntityContainersOperations", - "FeaturestoreEntityVersionsOperations", - "JobsOperations", - "LabelingJobsOperations", - "ModelContainersOperations", - "ModelVersionsOperations", - "OnlineEndpointsOperations", - "OnlineDeploymentsOperations", - "SchedulesOperations", -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_batch_deployments_operations.py deleted file mode 100644 index 29ca23a25950..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_batch_deployments_operations.py +++ /dev/null @@ -1,617 +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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/aio/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_batch_endpoints_operations.py deleted file mode 100644 index db542ac3d1f2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_batch_endpoints_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 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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_code_containers_operations.py deleted file mode 100644 index cc1bb58b8721..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_code_containers_operations.py +++ /dev/null @@ -1,313 +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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_code_versions_operations.py deleted file mode 100644 index 2bdbad859c47..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_code_versions_operations.py +++ /dev/null @@ -1,347 +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_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 - """ - api_version = kwargs.pop("api_version", "2023-02-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, - 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, - 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", "2023-02-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", "2023-02-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", "2023-02-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_component_containers_operations.py deleted file mode 100644 index 805a189f053a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_component_containers_operations.py +++ /dev/null @@ -1,327 +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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_component_versions_operations.py deleted file mode 100644 index 2707a6a6e2d5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_component_versions_operations.py +++ /dev/null @@ -1,352 +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_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 - """ - api_version = kwargs.pop("api_version", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_compute_operations.py deleted file mode 100644 index f7671fa05a31..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_compute_operations.py +++ /dev/null @@ -1,1121 +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_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_custom_services_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: - """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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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 - - 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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_data_containers_operations.py deleted file mode 100644 index c7f4cf6f91a7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_data_containers_operations.py +++ /dev/null @@ -1,322 +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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_data_versions_operations.py deleted file mode 100644 index c077bc314f34..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_data_versions_operations.py +++ /dev/null @@ -1,361 +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_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 - """ - api_version = kwargs.pop("api_version", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_datastores_operations.py deleted file mode 100644 index 3934a380bf4f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_datastores_operations.py +++ /dev/null @@ -1,410 +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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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, **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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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, - name=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("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/v2023_02_01_preview/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_environment_containers_operations.py deleted file mode 100644 index 354e7f90ca5c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_environment_containers_operations.py +++ /dev/null @@ -1,327 +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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_environment_versions_operations.py deleted file mode 100644 index 2b7ba57fef76..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_environment_versions_operations.py +++ /dev/null @@ -1,352 +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_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 - """ - api_version = kwargs.pop("api_version", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featureset_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featureset_containers_operations.py deleted file mode 100644 index 729a5ef162c8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featureset_containers_operations.py +++ /dev/null @@ -1,457 +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, - **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 - :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", "2023-02-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, - 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, - 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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/aio/operations/_featureset_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featureset_versions_operations.py deleted file mode 100644 index 9816963be4bb..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featureset_versions_operations.py +++ /dev/null @@ -1,903 +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_feature_request, - build_get_request, - build_list_features_request, - build_list_materialization_jobs_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, - **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 - :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", "2023-02-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, - 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, - 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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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 - - @distributed_trace_async - async def get_feature( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.GetFeatureRequest", - **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 name: Feature set name. This is case-sensitive. - :type name: str - :param version: Feature set version identifier. This is case-sensitive. - :type version: str - :param body: Feature Name request. This is case-sensitive. - :type body: ~azure.mgmt.machinelearningservices.models.GetFeatureRequest - :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", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - - _json = self._serialize.body(body, "GetFeatureRequest") - - request = build_get_feature_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.get_feature.metadata["url"], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_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_feature.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/getFeature"} # type: ignore - - @distributed_trace - def list_features( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - skip: Optional[str] = None, - tags: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeatureArmPaginatedResult"]: - """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 name: Featureset name. This is case-sensitive. - :type name: str - :param version: Featureset Version identifier. This is case-sensitive. - :type 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeatureArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeatureArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeatureArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop("error_map", {})) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_features_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, - skip=skip, - tags=tags, - template_url=self.list_features.metadata["url"], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_features_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, - skip=skip, - tags=tags, - 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("FeatureArmPaginatedResult", 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_features.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/listFeatures"} # type: ignore - - @distributed_trace - def list_materialization_jobs( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - skip: Optional[str] = None, - filters: Optional[str] = None, - feature_window_start: Optional[str] = None, - feature_window_end: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturesetJobArmPaginatedResult"]: - """List materialization Jobs. - - List materialization Jobs. - - :param resource_group_name: The name of the resource group. The name is 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 skip: Continuation token for pagination. - :type skip: str - :param filters: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type filters: str - :param feature_window_start: Start time of the feature window to filter materialization jobs. - :type feature_window_start: str - :param feature_window_end: End time of the feature window to filter materialization jobs. - :type feature_window_end: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetJobArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetJobArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetJobArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop("error_map", {})) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_materialization_jobs_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, - skip=skip, - filters=filters, - feature_window_start=feature_window_start, - feature_window_end=feature_window_end, - template_url=self.list_materialization_jobs.metadata["url"], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_materialization_jobs_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, - skip=skip, - filters=filters, - feature_window_start=feature_window_start, - feature_window_end=feature_window_end, - 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("FeaturesetJobArmPaginatedResult", 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_materialization_jobs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/listMaterializationJobs"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featurestore_entity_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featurestore_entity_containers_operations.py deleted file mode 100644 index a5b0e1626da4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featurestore_entity_containers_operations.py +++ /dev/null @@ -1,457 +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, - **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 - :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", "2023-02-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, - 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, - 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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/aio/operations/_featurestore_entity_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featurestore_entity_versions_operations.py deleted file mode 100644 index 85add1bd65d9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featurestore_entity_versions_operations.py +++ /dev/null @@ -1,475 +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, - **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 - :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", "2023-02-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, - 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, - 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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/aio/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_jobs_operations.py deleted file mode 100644 index 15c199d4f4e3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_jobs_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 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, - asset_name: Optional[str] = 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 asset_name: Asset name the job's named output is registered with. - :type asset_name: str - :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 - """ - api_version = kwargs.pop("api_version", "2023-02-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, - asset_name=asset_name, - 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, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - asset_name=asset_name, - 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( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=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", "2023-02-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", "2023-02-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", "2023-02-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. - - 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.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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/aio/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_labeling_jobs_operations.py deleted file mode 100644 index 38cb3351dd57..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_labeling_jobs_operations.py +++ /dev/null @@ -1,679 +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._labeling_jobs_operations import ( - build_create_or_update_request_initial, - build_delete_request, - build_export_labels_request_initial, - build_get_request, - build_list_request, - build_pause_request, - build_resume_request_initial, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class LabelingJobsOperations: - """LabelingJobsOperations 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, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncIterable["_models.LabelingJobResourceArmPaginatedResult"]: - """Lists labeling jobs in the workspace. - - Lists labeling 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 top: Number of labeling jobs to return. - :type top: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LabelingJobResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 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, - top=top, - 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, - top=top, - 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("LabelingJobResourceArmPaginatedResult", 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}/labelingJobs"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, id: str, **kwargs: Any - ) -> None: - """Delete a labeling job. - - Delete a labeling 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 LabelingJob. - :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", {})) - - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - request = build_delete_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.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}/labelingJobs/{id}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - id: str, - include_job_instructions: Optional[bool] = False, - include_label_categories: Optional[bool] = False, - **kwargs: Any - ) -> "_models.LabelingJob": - """Gets a labeling job by name/id. - - Gets a labeling 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 LabelingJob. - :type id: str - :param include_job_instructions: Boolean value to indicate whether to include JobInstructions - in response. - :type include_job_instructions: bool - :param include_label_categories: Boolean value to indicate Whether to include LabelCategories - in response. - :type include_label_categories: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LabelingJob, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJob - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop("error_map", {})) - - api_version = kwargs.pop("api_version", "2023-02-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, - include_job_instructions=include_job_instructions, - include_label_categories=include_label_categories, - 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("LabelingJob", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - async def _create_or_update_initial( - self, resource_group_name: str, workspace_name: str, id: str, body: "_models.LabelingJob", **kwargs: Any - ) -> "_models.LabelingJob": - cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop("error_map", {})) - - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - - _json = self._serialize.body(body, "LabelingJob") - - request = build_create_or_update_request_initial( - 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_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("LabelingJob", 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("LabelingJob", 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}/labelingJobs/{id}"} # type: ignore - - @distributed_trace_async - async def begin_create_or_update( - self, resource_group_name: str, workspace_name: str, id: str, body: "_models.LabelingJob", **kwargs: Any - ) -> AsyncLROPoller["_models.LabelingJob"]: - """Creates or updates a labeling job (asynchronous). - - Creates or updates a labeling 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 LabelingJob. - :type id: str - :param body: LabelingJob definition object. - :type body: ~azure.mgmt.machinelearningservices.models.LabelingJob - :keyword callable cls: A custom type or function that will be passed the direct response - :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 LabelingJob or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop("api_version", "2023-02-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.LabelingJob"] - lro_delay = kwargs.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, - id=id, - 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("LabelingJob", 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}/labelingJobs/{id}"} # type: ignore - - async def _export_labels_initial( - self, resource_group_name: str, workspace_name: str, id: str, body: "_models.ExportSummary", **kwargs: Any - ) -> Optional["_models.ExportSummary"]: - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.ExportSummary"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop("error_map", {})) - - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - - _json = self._serialize.body(body, "ExportSummary") - - request = build_export_labels_request_initial( - 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._export_labels_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("ExportSummary", 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 - - _export_labels_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - @distributed_trace_async - async def begin_export_labels( - self, resource_group_name: str, workspace_name: str, id: str, body: "_models.ExportSummary", **kwargs: Any - ) -> AsyncLROPoller["_models.ExportSummary"]: - """Export labels from a labeling job (asynchronous). - - Export labels from a labeling 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 LabelingJob. - :type id: str - :param body: The export summary. - :type body: ~azure.mgmt.machinelearningservices.models.ExportSummary - :keyword callable cls: A custom type or function that will be passed the direct response - :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 ExportSummary or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop("api_version", "2023-02-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.ExportSummary"] - lro_delay = kwargs.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._export_labels_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - 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("ExportSummary", 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_export_labels.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - @distributed_trace_async - async def pause( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, id: str, **kwargs: Any - ) -> None: - """Pause a labeling job. - - Pause a labeling 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 LabelingJob. - :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", {})) - - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - request = build_pause_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.pause.metadata["url"], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, 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, {}) - - pause.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - - async def _resume_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", "2023-02-01-preview") # type: str - - request = build_resume_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._resume_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) - - _resume_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore - - @distributed_trace_async - async def begin_resume( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, id: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Resume a labeling job (asynchronous). - - Resume a labeling 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 LabelingJob. - :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", "2023-02-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._resume_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_resume.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_model_containers_operations.py deleted file mode 100644 index 7f941eb87e45..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_model_containers_operations.py +++ /dev/null @@ -1,327 +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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_model_versions_operations.py deleted file mode 100644 index 8a5e9b5fd28e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_model_versions_operations.py +++ /dev/null @@ -1,514 +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_package_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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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 _package_initial( - self, resource_group_name: str, workspace_name: str, name: str, version: str, body: Any, **kwargs: Any - ) -> Optional["_models.PackageResponse"]: - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop("error_map", {})) - - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - - _json = self._serialize.body(body, "object") - - request = build_package_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._package_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("PackageResponse", 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 - - _package_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore - - @distributed_trace_async - async def begin_package( - self, resource_group_name: str, workspace_name: str, name: str, version: str, body: Any, **kwargs: Any - ) -> AsyncLROPoller["_models.PackageResponse"]: - """Model Version Package operation. - - Model Version Package 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 name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Package operation request body. - :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 PackageResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop("api_version", "2023-02-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.PackageResponse"] - lro_delay = kwargs.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._package_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("PackageResponse", 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_package.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_online_deployments_operations.py deleted file mode 100644 index f84bb48b077e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_online_deployments_operations.py +++ /dev/null @@ -1,790 +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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/aio/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_online_endpoints_operations.py deleted file mode 100644 index bc77e0cc8f3f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_online_endpoints_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 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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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 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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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/v2023_02_01_preview/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_operations.py deleted file mode 100644 index 7bfacf64e0c1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_operations.py +++ /dev/null @@ -1,117 +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.AmlOperationListResult"]: - """Lists all of the available Azure Machine Learning Services 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 AmlOperationListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.AmlOperationListResult"] - error_map = {401: ClientAuthenticationError, 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("AmlOperationListResult", 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/v2023_02_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index 25e58d070005..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,305 +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"]: - """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 - """ - api_version = kwargs.pop("api_version", "2023-02-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( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - 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) - - else: - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - 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("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 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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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, - 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", {})) - - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - 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, - 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 - - @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: - """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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_private_link_resources_operations.py deleted file mode 100644 index 34893a1b2472..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,102 +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._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", {})) - - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - 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) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, 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/v2023_02_01_preview/aio/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_quotas_operations.py deleted file mode 100644 index 33bbb771e8ae..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_quotas_operations.py +++ /dev/null @@ -1,177 +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", "2023-02-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", "2023-02-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/v2023_02_01_preview/aio/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registries_operations.py deleted file mode 100644 index 5102cd9bd3ae..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registries_operations.py +++ /dev/null @@ -1,611 +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_update_request_initial, -) - -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, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: - """List registries by subscription. - - List registries by 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 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", "2023-02-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, - 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, - 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("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, skip: Optional[str] = None, **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 - :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 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", "2023-02-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, - 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, - 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("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", "2023-02-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 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", "2023-02-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 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", "2023-02-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 - - async def _update_initial( - self, - resource_group_name: str, - registry_name: str, - body: "_models.PartialRegistryPartialTrackedResource", - **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", "2023-02-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_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._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("Registry", 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")) - - deserialized = self._deserialize("Registry", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - registry_name: str, - body: "_models.PartialRegistryPartialTrackedResource", - **kwargs: Any - ) -> AsyncLROPoller["_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 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 - :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", "2023-02-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._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": "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_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 - ) -> 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", "2023-02-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, 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("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 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", "2023-02-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_code_containers_operations.py deleted file mode 100644 index 9b21770ef925..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_code_containers_operations.py +++ /dev/null @@ -1,431 +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. - :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", "2023-02-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", "2023-02-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 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. - :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", "2023-02-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 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. - :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", "2023-02-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", "2023-02-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 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. - :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", "2023-02-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/v2023_02_01_preview/aio/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_code_versions_operations.py deleted file mode 100644 index ef26fd44c8e3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_code_versions_operations.py +++ /dev/null @@ -1,473 +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_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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_component_containers_operations.py deleted file mode 100644 index 61072c2b1b3a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_component_containers_operations.py +++ /dev/null @@ -1,441 +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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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/v2023_02_01_preview/aio/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_component_versions_operations.py deleted file mode 100644 index 4479dcec9b27..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_component_versions_operations.py +++ /dev/null @@ -1,473 +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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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/v2023_02_01_preview/aio/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_data_containers_operations.py deleted file mode 100644 index b70a7aab4203..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_data_containers_operations.py +++ /dev/null @@ -1,440 +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 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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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/v2023_02_01_preview/aio/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_data_versions_operations.py deleted file mode 100644 index 1919a81c3d2f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_data_versions_operations.py +++ /dev/null @@ -1,487 +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_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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_environment_containers_operations.py deleted file mode 100644 index 1608aec165a7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_environment_containers_operations.py +++ /dev/null @@ -1,450 +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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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/v2023_02_01_preview/aio/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_environment_versions_operations.py deleted file mode 100644 index 9c4d21aabb8b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_environment_versions_operations.py +++ /dev/null @@ -1,478 +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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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/v2023_02_01_preview/aio/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_model_containers_operations.py deleted file mode 100644 index 5ed15cf89259..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_model_containers_operations.py +++ /dev/null @@ -1,450 +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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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/v2023_02_01_preview/aio/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_model_versions_operations.py deleted file mode 100644 index f6ba942a2b50..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_model_versions_operations.py +++ /dev/null @@ -1,500 +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_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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_schedules_operations.py deleted file mode 100644 index 501e2b9f31af..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_schedules_operations.py +++ /dev/null @@ -1,437 +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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/aio/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_usages_operations.py deleted file mode 100644 index 1cdee4fdcf38..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_usages_operations.py +++ /dev/null @@ -1,123 +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", "2023-02-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/v2023_02_01_preview/aio/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_virtual_machine_sizes_operations.py deleted file mode 100644 index 959b2152f082..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_virtual_machine_sizes_operations.py +++ /dev/null @@ -1,97 +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", "2023-02-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/v2023_02_01_preview/aio/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_workspace_connections_operations.py deleted file mode 100644 index 0d614baeddd3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_workspace_connections_operations.py +++ /dev/null @@ -1,320 +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._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", {})) - - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - 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, - 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 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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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 delete( # pylint: disable=inconsistent-return-statements - 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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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 - 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 - """ - api_version = kwargs.pop("api_version", "2023-02-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, - 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, - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_workspace_features_operations.py deleted file mode 100644 index 9811905960d7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_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", "2023-02-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/v2023_02_01_preview/aio/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_workspaces_operations.py deleted file mode 100644 index 759b4dc3b034..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_workspaces_operations.py +++ /dev/null @@ -1,1167 +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_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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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 _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", {})) - - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - 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, - 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 - 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 - """ - api_version = kwargs.pop("api_version", "2023-02-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, - 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("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_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - async def _delete_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", "2023-02-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, - 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) - - 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( # pylint: disable=inconsistent-return-statements - 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 - """ - api_version = kwargs.pop("api_version", "2023-02-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, - 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}"} # 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", {})) - - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - 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, - 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, - 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 - """ - api_version = kwargs.pop("api_version", "2023-02-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, - 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("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 - - @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 - """ - api_version = kwargs.pop("api_version", "2023-02-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, - 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, - 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("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 _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", {})) - - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - 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, - 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, - 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 - """ - api_version = kwargs.pop("api_version", "2023-02-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, - 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("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. - - :param resource_group_name: The name of the resource 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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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 - - 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", "2023-02-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) - - 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( # 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. - - :param resource_group_name: The name of the resource 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 - """ - api_version = kwargs.pop("api_version", "2023-02-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, **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 - - @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 - """ - api_version = kwargs.pop("api_version", "2023-02-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, - 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, - 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("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_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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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 - - 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", "2023-02-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 - 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 - """ - api_version = kwargs.pop("api_version", "2023-02-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 - - @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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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_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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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_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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/__init__.py deleted file mode 100644 index 1033641177df..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/__init__.py +++ /dev/null @@ -1,1734 +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 AKSSchema - from ._models_py3 import AKSSchemaProperties - from ._models_py3 import AccessKeyAuthTypeWorkspaceConnectionProperties - 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 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 AmlOperation - from ._models_py3 import AmlOperationDisplay - from ._models_py3 import AmlOperationListResult - from ._models_py3 import AmlToken - from ._models_py3 import AmlUserFeature - 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 AutologgerSettings - from ._models_py3 import AzureBlobDatastore - from ._models_py3 import AzureDataLakeGen1Datastore - from ._models_py3 import AzureDataLakeGen2Datastore - from ._models_py3 import AzureDatastore - from ._models_py3 import AzureFileDatastore - from ._models_py3 import AzureMLBatchInferencingServer - from ._models_py3 import AzureMLOnlineInferencingServer - from ._models_py3 import BanditPolicy - from ._models_py3 import BaseEnvironmentId - from ._models_py3 import BaseEnvironmentSource - from ._models_py3 import BatchDeployment - from ._models_py3 import BatchDeploymentProperties - from ._models_py3 import BatchDeploymentPropertiesAutoGenerated - 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 BatchPipelineComponentDeploymentProperties - from ._models_py3 import BatchRetrySettings - from ._models_py3 import BayesianSamplingAlgorithm - from ._models_py3 import BindOptions - from ._models_py3 import BuildContext - 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 CocoExportSummary - 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 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 ComputeResource - from ._models_py3 import ComputeResourceSchema - 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 CosmosDbSettings - from ._models_py3 import CronTrigger - from ._models_py3 import CsvExportSummary - from ._models_py3 import CustomForecastHorizon - from ._models_py3 import CustomInferencingServer - from ._models_py3 import CustomModelJobInput - from ._models_py3 import CustomModelJobOutput - 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 DataContainer - from ._models_py3 import DataContainerProperties - from ._models_py3 import DataContainerResourceArmPaginatedResult - 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 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 DatasetExportSummary - 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 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 EarlyTerminationPolicy - from ._models_py3 import EncryptionKeyVaultProperties - 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 EndpointDeploymentPropertiesBase - from ._models_py3 import EndpointPropertiesBase - 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 ExportSummary - 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 Feature - from ._models_py3 import FeatureArmPaginatedResult - from ._models_py3 import FeatureWindow - from ._models_py3 import FeaturesetContainer - from ._models_py3 import FeaturesetContainerProperties - from ._models_py3 import FeaturesetContainerResourceArmPaginatedResult - from ._models_py3 import FeaturesetJob - from ._models_py3 import FeaturesetJobArmPaginatedResult - 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 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 GetFeatureRequest - from ._models_py3 import GridSamplingAlgorithm - from ._models_py3 import HDInsight - from ._models_py3 import HDInsightProperties - from ._models_py3 import HDInsightSchema - from ._models_py3 import HdfsDatastore - 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 InferencingServer - 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 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 Kubernetes - from ._models_py3 import KubernetesOnlineDeployment - from ._models_py3 import KubernetesProperties - from ._models_py3 import KubernetesSchema - from ._models_py3 import LabelCategory - from ._models_py3 import LabelClass - from ._models_py3 import LabelingDataConfiguration - from ._models_py3 import LabelingJob - from ._models_py3 import LabelingJobImageProperties - from ._models_py3 import LabelingJobInstructions - from ._models_py3 import LabelingJobMediaProperties - from ._models_py3 import LabelingJobProperties - from ._models_py3 import LabelingJobResourceArmPaginatedResult - from ._models_py3 import LabelingJobTextProperties - 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 MLAssistConfiguration - from ._models_py3 import MLAssistConfigurationDisabled - from ._models_py3 import MLAssistConfigurationEnabled - 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 ManagedIdentityAuthTypeWorkspaceConnectionProperties - from ._models_py3 import ManagedOnlineDeployment - from ._models_py3 import ManagedServiceIdentity - from ._models_py3 import MaterializationComputeResource - from ._models_py3 import MaterializationSettings - from ._models_py3 import MedianStoppingPolicy - from ._models_py3 import ModelConfiguration - from ._models_py3 import ModelContainer - from ._models_py3 import ModelContainerProperties - from ._models_py3 import ModelContainerResourceArmPaginatedResult - from ._models_py3 import ModelPackageInput - from ._models_py3 import ModelVersion - from ._models_py3 import ModelVersionProperties - from ._models_py3 import ModelVersionResourceArmPaginatedResult - from ._models_py3 import Mpi - from ._models_py3 import NCrossValidations - from ._models_py3 import NlpFixedParameters - from ._models_py3 import NlpParameterSubspace - from ._models_py3 import NlpSweepSettings - 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 Objective - 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 OnlineInferenceConfiguration - from ._models_py3 import OnlineRequestSettings - from ._models_py3 import OnlineScaleSettings - from ._models_py3 import OutputPathAssetReference - from ._models_py3 import PATAuthTypeWorkspaceConnectionProperties - from ._models_py3 import PackageInputPathBase - from ._models_py3 import PackageInputPathId - from ._models_py3 import PackageInputPathUrl - from ._models_py3 import PackageInputPathVersion - from ._models_py3 import PackageRequest - from ._models_py3 import PackageResponse - 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 PartialRegistryPartialTrackedResource - from ._models_py3 import PartialSku - from ._models_py3 import Password - from ._models_py3 import PersonalComputeInstanceSettings - from ._models_py3 import PipelineJob - 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 ProbeSettings - from ._models_py3 import ProgressMetrics - from ._models_py3 import PyTorch - from ._models_py3 import QueueSettings - from ._models_py3 import QuotaBaseProperties - from ._models_py3 import QuotaUpdateParameters - from ._models_py3 import RandomSamplingAlgorithm - from ._models_py3 import RecurrenceSchedule - from ._models_py3 import RecurrenceTrigger - from ._models_py3 import RegenerateEndpointKeysRequest - from ._models_py3 import Registry - from ._models_py3 import RegistryListCredentialsResult - from ._models_py3 import RegistryProperties - from ._models_py3 import RegistryRegionArmDetails - from ._models_py3 import RegistryTrackedResourceArmPaginatedResult - from ._models_py3 import Regression - from ._models_py3 import RegressionTrainingSettings - 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 Route - from ._models_py3 import SASAuthTypeWorkspaceConnectionProperties - 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 ServiceManagedResourcesSettings - from ._models_py3 import ServicePrincipalAuthTypeWorkspaceConnectionProperties - from ._models_py3 import ServicePrincipalDatastoreCredentials - from ._models_py3 import ServicePrincipalDatastoreSecrets - 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 SslConfiguration - from ._models_py3 import StackEnsembleSettings - from ._models_py3 import StatusMessage - 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 TableFixedParameters - from ._models_py3 import TableParameterSubspace - from ._models_py3 import TableSweepSettings - 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 TrackedResource - from ._models_py3 import TrainingSettings - from ._models_py3 import TrialComponent - from ._models_py3 import TriggerBase - from ._models_py3 import TritonInferencingServer - 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 Workspace - from ._models_py3 import WorkspaceConnectionAccessKey - from ._models_py3 import WorkspaceConnectionManagedIdentity - 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 WorkspaceConnectionUsernamePassword - from ._models_py3 import WorkspaceListResult - from ._models_py3 import WorkspaceUpdateParameters -except (SyntaxError, ImportError): - 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 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 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 AmlOperation # type: ignore - from ._models import AmlOperationDisplay # type: ignore - from ._models import AmlOperationListResult # type: ignore - from ._models import AmlToken # type: ignore - from ._models import AmlUserFeature # 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 AutologgerSettings # 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 AzureFileDatastore # type: ignore - from ._models import AzureMLBatchInferencingServer # type: ignore - from ._models import AzureMLOnlineInferencingServer # type: ignore - from ._models import BanditPolicy # type: ignore - from ._models import BaseEnvironmentId # type: ignore - from ._models import BaseEnvironmentSource # type: ignore - from ._models import BatchDeployment # type: ignore - from ._models import BatchDeploymentProperties # type: ignore - from ._models import BatchDeploymentPropertiesAutoGenerated # 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 BatchPipelineComponentDeploymentProperties # type: ignore - from ._models import BatchRetrySettings # type: ignore - from ._models import BayesianSamplingAlgorithm # type: ignore - from ._models import BindOptions # 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 ClassificationTrainingSettings # type: ignore - from ._models import ClusterUpdateParameters # type: ignore - from ._models import CocoExportSummary # 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 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 ComputeResource # type: ignore - from ._models import ComputeResourceSchema # 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 CosmosDbSettings # type: ignore - from ._models import CronTrigger # type: ignore - from ._models import CsvExportSummary # type: ignore - from ._models import CustomForecastHorizon # type: ignore - from ._models import CustomInferencingServer # 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 CustomService # type: ignore - from ._models import CustomTargetLags # type: ignore - from ._models import CustomTargetRollingWindowSize # type: ignore - from ._models import DataContainer # type: ignore - from ._models import DataContainerProperties # type: ignore - from ._models import DataContainerResourceArmPaginatedResult # 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 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 DatasetExportSummary # 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 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 EarlyTerminationPolicy # type: ignore - from ._models import EncryptionKeyVaultProperties # 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 EndpointDeploymentPropertiesBase # type: ignore - from ._models import EndpointPropertiesBase # 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 ExportSummary # 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 Feature # type: ignore - from ._models import FeatureArmPaginatedResult # 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 FeaturesetJob # type: ignore - from ._models import FeaturesetJobArmPaginatedResult # 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 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 GetFeatureRequest # 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 HdfsDatastore # 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 InferencingServer # 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 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 Kubernetes # type: ignore - from ._models import KubernetesOnlineDeployment # type: ignore - from ._models import KubernetesProperties # type: ignore - from ._models import KubernetesSchema # type: ignore - from ._models import LabelCategory # type: ignore - from ._models import LabelClass # type: ignore - from ._models import LabelingDataConfiguration # type: ignore - from ._models import LabelingJob # type: ignore - from ._models import LabelingJobImageProperties # type: ignore - from ._models import LabelingJobInstructions # type: ignore - from ._models import LabelingJobMediaProperties # type: ignore - from ._models import LabelingJobProperties # type: ignore - from ._models import LabelingJobResourceArmPaginatedResult # type: ignore - from ._models import LabelingJobTextProperties # 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 MLAssistConfiguration # type: ignore - from ._models import MLAssistConfigurationDisabled # type: ignore - from ._models import MLAssistConfigurationEnabled # 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 ManagedIdentityAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import ManagedOnlineDeployment # type: ignore - from ._models import ManagedServiceIdentity # type: ignore - from ._models import MaterializationComputeResource # type: ignore - from ._models import MaterializationSettings # type: ignore - from ._models import MedianStoppingPolicy # type: ignore - from ._models import ModelConfiguration # type: ignore - from ._models import ModelContainer # type: ignore - from ._models import ModelContainerProperties # type: ignore - from ._models import ModelContainerResourceArmPaginatedResult # type: ignore - from ._models import ModelPackageInput # type: ignore - from ._models import ModelVersion # type: ignore - from ._models import ModelVersionProperties # type: ignore - from ._models import ModelVersionResourceArmPaginatedResult # type: ignore - from ._models import Mpi # type: ignore - from ._models import NCrossValidations # type: ignore - from ._models import NlpFixedParameters # type: ignore - from ._models import NlpParameterSubspace # type: ignore - from ._models import NlpSweepSettings # 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 Objective # 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 OnlineInferenceConfiguration # type: ignore - from ._models import OnlineRequestSettings # type: ignore - from ._models import OnlineScaleSettings # type: ignore - from ._models import OutputPathAssetReference # type: ignore - from ._models import PATAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import PackageInputPathBase # type: ignore - from ._models import PackageInputPathId # type: ignore - from ._models import PackageInputPathUrl # type: ignore - from ._models import PackageInputPathVersion # type: ignore - from ._models import PackageRequest # type: ignore - from ._models import PackageResponse # 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 PartialRegistryPartialTrackedResource # type: ignore - from ._models import PartialSku # type: ignore - from ._models import Password # type: ignore - from ._models import PersonalComputeInstanceSettings # type: ignore - from ._models import PipelineJob # 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 ProbeSettings # type: ignore - from ._models import ProgressMetrics # 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 RandomSamplingAlgorithm # type: ignore - from ._models import RecurrenceSchedule # type: ignore - from ._models import RecurrenceTrigger # type: ignore - from ._models import RegenerateEndpointKeysRequest # type: ignore - from ._models import Registry # type: ignore - from ._models import RegistryListCredentialsResult # type: ignore - from ._models import RegistryProperties # 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 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 Route # type: ignore - from ._models import SASAuthTypeWorkspaceConnectionProperties # 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 ServiceManagedResourcesSettings # type: ignore - from ._models import ServicePrincipalAuthTypeWorkspaceConnectionProperties # type: ignore - from ._models import ServicePrincipalDatastoreCredentials # type: ignore - from ._models import ServicePrincipalDatastoreSecrets # 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 SslConfiguration # type: ignore - from ._models import StackEnsembleSettings # type: ignore - from ._models import StatusMessage # 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 TableFixedParameters # type: ignore - from ._models import TableParameterSubspace # type: ignore - from ._models import TableSweepSettings # 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 TrackedResource # type: ignore - from ._models import TrainingSettings # type: ignore - from ._models import TrialComponent # type: ignore - from ._models import TriggerBase # type: ignore - from ._models import TritonInferencingServer # 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 Workspace # type: ignore - from ._models import WorkspaceConnectionAccessKey # type: ignore - from ._models import WorkspaceConnectionManagedIdentity # 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 WorkspaceConnectionUsernamePassword # type: ignore - from ._models import WorkspaceListResult # type: ignore - from ._models import WorkspaceUpdateParameters # type: ignore - -from ._azure_machine_learning_workspaces_enums import ( - AllocationState, - ApplicationSharingPolicy, - AssetProvisioningState, - AutoRebuildSetting, - Autosave, - BaseEnvironmentSourceType, - BatchDeploymentPropertyType, - BatchLoggingLevel, - BatchOutputAction, - BillingCurrency, - BlockedTransformers, - Caching, - ClassificationModels, - ClassificationMultilabelPrimaryMetrics, - ClassificationPrimaryMetrics, - ClusterPurpose, - ComputeInstanceAuthorizationType, - ComputeInstanceState, - ComputePowerAction, - ComputeType, - ConnectionAuthType, - ConnectionCategory, - ContainerType, - CreatedByType, - CredentialsType, - DataType, - DatastoreType, - DeploymentProvisioningState, - DiagnoseResultLevel, - DistributionType, - EarlyTerminationPolicyType, - EgressPublicNetworkAccessType, - EmailNotificationEnableType, - EncryptionStatus, - EndpointAuthMode, - EndpointComputeType, - EndpointProvisioningState, - EnvironmentType, - EnvironmentVariableType, - ExportFormatType, - FeatureDataType, - FeatureLags, - FeaturestoreJobType, - FeaturizationMode, - ForecastHorizonMode, - ForecastingModels, - ForecastingPrimaryMetrics, - Goal, - IdentityConfigurationType, - ImageAnnotationType, - ImageType, - IncrementalDataRefresh, - InferencingServerType, - InputDeliveryMode, - InputPathType, - InstanceSegmentationPrimaryMetrics, - JobInputType, - JobLimitsType, - JobOutputType, - JobProvisioningState, - JobStatus, - JobTier, - JobType, - KeyType, - LearningRateScheduler, - ListViewType, - LoadBalancerType, - LogVerbosity, - MLAssistConfigurationType, - MLFlowAutologgerState, - ManagedServiceIdentityType, - MaterializationStoreType, - MediaType, - MlflowAutologger, - ModelSize, - MountAction, - MountState, - MultiSelect, - NCrossValidationsMode, - Network, - NlpLearningRateScheduler, - NodeState, - NodesValueType, - ObjectDetectionPrimaryMetrics, - OperatingSystemType, - OperationName, - OperationStatus, - OperationTrigger, - OrderString, - OsType, - OutputDeliveryMode, - PackageBuildState, - PackageInputDeliveryMode, - PackageInputType, - PrivateEndpointConnectionProvisioningState, - PrivateEndpointServiceConnectionStatus, - Protocol, - ProvisioningState, - ProvisioningStatus, - PublicNetworkAccess, - PublicNetworkAccessType, - QuotaUnit, - RandomSamplingAlgorithmRule, - RecurrenceFrequency, - ReferenceType, - RegressionModels, - RegressionPrimaryMetrics, - RemoteLoginPortPublicAccess, - SamplingAlgorithmType, - ScaleType, - ScheduleActionType, - ScheduleListViewType, - ScheduleProvisioningState, - ScheduleProvisioningStatus, - ScheduleStatus, - SeasonalityMode, - SecretsType, - ServiceDataAccessAuthIdentity, - ShortSeriesHandlingConfiguration, - SkuScaleType, - SkuTier, - SourceType, - SparkJobEntryType, - SshPublicAccess, - SslConfigStatus, - StackMetaLearnerType, - Status, - StatusMessageLevel, - StochasticOptimizer, - StorageAccountType, - TargetAggregationFunction, - TargetLagsMode, - TargetRollingWindowSizeMode, - TaskType, - TextAnnotationType, - TrainingMode, - TriggerType, - UnderlyingResourceAction, - UnitOfMeasure, - UsageUnit, - UseStl, - VMPriceOSType, - VMTier, - ValidationMetricType, - ValueFormat, - VmPriority, - VolumeDefinitionType, - WeekDay, -) - -__all__ = [ - "AKS", - "AKSSchema", - "AKSSchemaProperties", - "AccessKeyAuthTypeWorkspaceConnectionProperties", - "AccountKeyDatastoreCredentials", - "AccountKeyDatastoreSecrets", - "AcrDetails", - "AksComputeSecrets", - "AksComputeSecretsProperties", - "AksNetworkingConfiguration", - "AllNodes", - "AmlCompute", - "AmlComputeNodeInformation", - "AmlComputeNodesInformation", - "AmlComputeProperties", - "AmlComputeSchema", - "AmlOperation", - "AmlOperationDisplay", - "AmlOperationListResult", - "AmlToken", - "AmlUserFeature", - "ArmResourceId", - "AssetBase", - "AssetContainer", - "AssetJobInput", - "AssetJobOutput", - "AssetReferenceBase", - "AssignedUser", - "AutoForecastHorizon", - "AutoMLJob", - "AutoMLVertical", - "AutoNCrossValidations", - "AutoPauseProperties", - "AutoScaleProperties", - "AutoSeasonality", - "AutoTargetLags", - "AutoTargetRollingWindowSize", - "AutologgerSettings", - "AzureBlobDatastore", - "AzureDataLakeGen1Datastore", - "AzureDataLakeGen2Datastore", - "AzureDatastore", - "AzureFileDatastore", - "AzureMLBatchInferencingServer", - "AzureMLOnlineInferencingServer", - "BanditPolicy", - "BaseEnvironmentId", - "BaseEnvironmentSource", - "BatchDeployment", - "BatchDeploymentProperties", - "BatchDeploymentPropertiesAutoGenerated", - "BatchDeploymentTrackedResourceArmPaginatedResult", - "BatchEndpoint", - "BatchEndpointDefaults", - "BatchEndpointProperties", - "BatchEndpointTrackedResourceArmPaginatedResult", - "BatchPipelineComponentDeploymentProperties", - "BatchRetrySettings", - "BayesianSamplingAlgorithm", - "BindOptions", - "BuildContext", - "CertificateDatastoreCredentials", - "CertificateDatastoreSecrets", - "Classification", - "ClassificationTrainingSettings", - "ClusterUpdateParameters", - "CocoExportSummary", - "CodeConfiguration", - "CodeContainer", - "CodeContainerProperties", - "CodeContainerResourceArmPaginatedResult", - "CodeVersion", - "CodeVersionProperties", - "CodeVersionResourceArmPaginatedResult", - "ColumnTransformer", - "CommandJob", - "CommandJobLimits", - "ComponentContainer", - "ComponentContainerProperties", - "ComponentContainerResourceArmPaginatedResult", - "ComponentVersion", - "ComponentVersionProperties", - "ComponentVersionResourceArmPaginatedResult", - "Compute", - "ComputeInstance", - "ComputeInstanceApplication", - "ComputeInstanceAutologgerSettings", - "ComputeInstanceConnectivityEndpoints", - "ComputeInstanceContainer", - "ComputeInstanceCreatedBy", - "ComputeInstanceDataDisk", - "ComputeInstanceDataMount", - "ComputeInstanceEnvironmentInfo", - "ComputeInstanceLastOperation", - "ComputeInstanceProperties", - "ComputeInstanceSchema", - "ComputeInstanceSshSettings", - "ComputeInstanceVersion", - "ComputeResource", - "ComputeResourceSchema", - "ComputeSchedules", - "ComputeSecrets", - "ComputeStartStopSchedule", - "ContainerResourceRequirements", - "ContainerResourceSettings", - "CosmosDbSettings", - "CronTrigger", - "CsvExportSummary", - "CustomForecastHorizon", - "CustomInferencingServer", - "CustomModelJobInput", - "CustomModelJobOutput", - "CustomNCrossValidations", - "CustomSeasonality", - "CustomService", - "CustomTargetLags", - "CustomTargetRollingWindowSize", - "DataContainer", - "DataContainerProperties", - "DataContainerResourceArmPaginatedResult", - "DataFactory", - "DataLakeAnalytics", - "DataLakeAnalyticsSchema", - "DataLakeAnalyticsSchemaProperties", - "DataPathAssetReference", - "DataVersionBase", - "DataVersionBaseProperties", - "DataVersionBaseResourceArmPaginatedResult", - "Databricks", - "DatabricksComputeSecrets", - "DatabricksComputeSecretsProperties", - "DatabricksProperties", - "DatabricksSchema", - "DatasetExportSummary", - "Datastore", - "DatastoreCredentials", - "DatastoreProperties", - "DatastoreResourceArmPaginatedResult", - "DatastoreSecrets", - "DefaultScaleSettings", - "DeploymentLogs", - "DeploymentLogsRequest", - "DeploymentResourceConfiguration", - "DiagnoseRequestProperties", - "DiagnoseResponseResult", - "DiagnoseResponseResultValue", - "DiagnoseResult", - "DiagnoseWorkspaceParameters", - "DistributionConfiguration", - "Docker", - "EarlyTerminationPolicy", - "EncryptionKeyVaultProperties", - "EncryptionKeyVaultUpdateProperties", - "EncryptionProperty", - "EncryptionUpdateProperties", - "Endpoint", - "EndpointAuthKeys", - "EndpointAuthToken", - "EndpointDeploymentPropertiesBase", - "EndpointPropertiesBase", - "EndpointScheduleAction", - "EnvironmentContainer", - "EnvironmentContainerProperties", - "EnvironmentContainerResourceArmPaginatedResult", - "EnvironmentVariable", - "EnvironmentVersion", - "EnvironmentVersionProperties", - "EnvironmentVersionResourceArmPaginatedResult", - "ErrorAdditionalInfo", - "ErrorDetail", - "ErrorResponse", - "EstimatedVMPrice", - "EstimatedVMPrices", - "ExportSummary", - "ExternalFQDNResponse", - "FQDNEndpoint", - "FQDNEndpointDetail", - "FQDNEndpoints", - "FQDNEndpointsProperties", - "Feature", - "FeatureArmPaginatedResult", - "FeatureWindow", - "FeaturesetContainer", - "FeaturesetContainerProperties", - "FeaturesetContainerResourceArmPaginatedResult", - "FeaturesetJob", - "FeaturesetJobArmPaginatedResult", - "FeaturesetSpecification", - "FeaturesetVersion", - "FeaturesetVersionBackfillRequest", - "FeaturesetVersionBackfillResponse", - "FeaturesetVersionProperties", - "FeaturesetVersionResourceArmPaginatedResult", - "FeaturestoreEntityContainer", - "FeaturestoreEntityContainerProperties", - "FeaturestoreEntityContainerResourceArmPaginatedResult", - "FeaturestoreEntityVersion", - "FeaturestoreEntityVersionProperties", - "FeaturestoreEntityVersionResourceArmPaginatedResult", - "FeaturizationSettings", - "FlavorData", - "ForecastHorizon", - "Forecasting", - "ForecastingSettings", - "ForecastingTrainingSettings", - "GetFeatureRequest", - "GridSamplingAlgorithm", - "HDInsight", - "HDInsightProperties", - "HDInsightSchema", - "HdfsDatastore", - "IdAssetReference", - "IdentityConfiguration", - "IdentityForCmk", - "IdleShutdownSetting", - "Image", - "ImageClassification", - "ImageClassificationBase", - "ImageClassificationMultilabel", - "ImageInstanceSegmentation", - "ImageLimitSettings", - "ImageMetadata", - "ImageModelDistributionSettings", - "ImageModelDistributionSettingsClassification", - "ImageModelDistributionSettingsObjectDetection", - "ImageModelSettings", - "ImageModelSettingsClassification", - "ImageModelSettingsObjectDetection", - "ImageObjectDetection", - "ImageObjectDetectionBase", - "ImageSweepSettings", - "ImageVertical", - "IndexColumn", - "InferenceContainerProperties", - "InferencingServer", - "InstanceTypeSchema", - "InstanceTypeSchemaResources", - "JobBase", - "JobBaseProperties", - "JobBaseResourceArmPaginatedResult", - "JobInput", - "JobLimits", - "JobOutput", - "JobResourceConfiguration", - "JobScheduleAction", - "JobService", - "KerberosCredentials", - "KerberosKeytabCredentials", - "KerberosKeytabSecrets", - "KerberosPasswordCredentials", - "KerberosPasswordSecrets", - "Kubernetes", - "KubernetesOnlineDeployment", - "KubernetesProperties", - "KubernetesSchema", - "LabelCategory", - "LabelClass", - "LabelingDataConfiguration", - "LabelingJob", - "LabelingJobImageProperties", - "LabelingJobInstructions", - "LabelingJobMediaProperties", - "LabelingJobProperties", - "LabelingJobResourceArmPaginatedResult", - "LabelingJobTextProperties", - "ListAmlUserFeatureResult", - "ListNotebookKeysResult", - "ListStorageAccountKeysResult", - "ListUsagesResult", - "ListWorkspaceKeysResult", - "ListWorkspaceQuotas", - "LiteralJobInput", - "MLAssistConfiguration", - "MLAssistConfigurationDisabled", - "MLAssistConfigurationEnabled", - "MLFlowModelJobInput", - "MLFlowModelJobOutput", - "MLTableData", - "MLTableJobInput", - "MLTableJobOutput", - "ManagedIdentity", - "ManagedIdentityAuthTypeWorkspaceConnectionProperties", - "ManagedOnlineDeployment", - "ManagedServiceIdentity", - "MaterializationComputeResource", - "MaterializationSettings", - "MedianStoppingPolicy", - "ModelConfiguration", - "ModelContainer", - "ModelContainerProperties", - "ModelContainerResourceArmPaginatedResult", - "ModelPackageInput", - "ModelVersion", - "ModelVersionProperties", - "ModelVersionResourceArmPaginatedResult", - "Mpi", - "NCrossValidations", - "NlpFixedParameters", - "NlpParameterSubspace", - "NlpSweepSettings", - "NlpVertical", - "NlpVerticalFeaturizationSettings", - "NlpVerticalLimitSettings", - "NodeStateCounts", - "Nodes", - "NoneAuthTypeWorkspaceConnectionProperties", - "NoneDatastoreCredentials", - "NotebookAccessTokenResult", - "NotebookPreparationError", - "NotebookResourceInfo", - "NotificationSetting", - "Objective", - "OnlineDeployment", - "OnlineDeploymentProperties", - "OnlineDeploymentTrackedResourceArmPaginatedResult", - "OnlineEndpoint", - "OnlineEndpointProperties", - "OnlineEndpointTrackedResourceArmPaginatedResult", - "OnlineInferenceConfiguration", - "OnlineRequestSettings", - "OnlineScaleSettings", - "OutputPathAssetReference", - "PATAuthTypeWorkspaceConnectionProperties", - "PackageInputPathBase", - "PackageInputPathId", - "PackageInputPathUrl", - "PackageInputPathVersion", - "PackageRequest", - "PackageResponse", - "PaginatedComputeResourcesList", - "PartialBatchDeployment", - "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", - "PartialManagedServiceIdentity", - "PartialMinimalTrackedResource", - "PartialMinimalTrackedResourceWithIdentity", - "PartialMinimalTrackedResourceWithSku", - "PartialRegistryPartialTrackedResource", - "PartialSku", - "Password", - "PersonalComputeInstanceSettings", - "PipelineJob", - "PrivateEndpoint", - "PrivateEndpointConnection", - "PrivateEndpointConnectionListResult", - "PrivateLinkResource", - "PrivateLinkResourceListResult", - "PrivateLinkServiceConnectionState", - "ProbeSettings", - "ProgressMetrics", - "PyTorch", - "QueueSettings", - "QuotaBaseProperties", - "QuotaUpdateParameters", - "RandomSamplingAlgorithm", - "RecurrenceSchedule", - "RecurrenceTrigger", - "RegenerateEndpointKeysRequest", - "Registry", - "RegistryListCredentialsResult", - "RegistryProperties", - "RegistryRegionArmDetails", - "RegistryTrackedResourceArmPaginatedResult", - "Regression", - "RegressionTrainingSettings", - "Resource", - "ResourceBase", - "ResourceConfiguration", - "ResourceId", - "ResourceName", - "ResourceQuota", - "Route", - "SASAuthTypeWorkspaceConnectionProperties", - "SamplingAlgorithm", - "SasDatastoreCredentials", - "SasDatastoreSecrets", - "ScaleSettings", - "ScaleSettingsInformation", - "Schedule", - "ScheduleActionBase", - "ScheduleBase", - "ScheduleProperties", - "ScheduleResourceArmPaginatedResult", - "ScriptReference", - "ScriptsToExecute", - "Seasonality", - "ServiceManagedResourcesSettings", - "ServicePrincipalAuthTypeWorkspaceConnectionProperties", - "ServicePrincipalDatastoreCredentials", - "ServicePrincipalDatastoreSecrets", - "SetupScripts", - "SharedPrivateLinkResource", - "Sku", - "SkuCapacity", - "SkuResource", - "SkuResourceArmPaginatedResult", - "SkuSetting", - "SparkJob", - "SparkJobEntry", - "SparkJobPythonEntry", - "SparkJobScalaEntry", - "SparkResourceConfiguration", - "SslConfiguration", - "StackEnsembleSettings", - "StatusMessage", - "StorageAccountDetails", - "SweepJob", - "SweepJobLimits", - "SynapseSpark", - "SynapseSparkProperties", - "SystemCreatedAcrAccount", - "SystemCreatedStorageAccount", - "SystemData", - "SystemService", - "TableFixedParameters", - "TableParameterSubspace", - "TableSweepSettings", - "TableVertical", - "TableVerticalFeaturizationSettings", - "TableVerticalLimitSettings", - "TargetLags", - "TargetRollingWindowSize", - "TargetUtilizationScaleSettings", - "TensorFlow", - "TextClassification", - "TextClassificationMultilabel", - "TextNer", - "TmpfsOptions", - "TrackedResource", - "TrainingSettings", - "TrialComponent", - "TriggerBase", - "TritonInferencingServer", - "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", - "Workspace", - "WorkspaceConnectionAccessKey", - "WorkspaceConnectionManagedIdentity", - "WorkspaceConnectionPersonalAccessToken", - "WorkspaceConnectionPropertiesV2", - "WorkspaceConnectionPropertiesV2BasicResource", - "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", - "WorkspaceConnectionServicePrincipal", - "WorkspaceConnectionSharedAccessSignature", - "WorkspaceConnectionUsernamePassword", - "WorkspaceListResult", - "WorkspaceUpdateParameters", - "AllocationState", - "ApplicationSharingPolicy", - "AssetProvisioningState", - "AutoRebuildSetting", - "Autosave", - "BaseEnvironmentSourceType", - "BatchDeploymentPropertyType", - "BatchLoggingLevel", - "BatchOutputAction", - "BillingCurrency", - "BlockedTransformers", - "Caching", - "ClassificationModels", - "ClassificationMultilabelPrimaryMetrics", - "ClassificationPrimaryMetrics", - "ClusterPurpose", - "ComputeInstanceAuthorizationType", - "ComputeInstanceState", - "ComputePowerAction", - "ComputeType", - "ConnectionAuthType", - "ConnectionCategory", - "ContainerType", - "CreatedByType", - "CredentialsType", - "DataType", - "DatastoreType", - "DeploymentProvisioningState", - "DiagnoseResultLevel", - "DistributionType", - "EarlyTerminationPolicyType", - "EgressPublicNetworkAccessType", - "EmailNotificationEnableType", - "EncryptionStatus", - "EndpointAuthMode", - "EndpointComputeType", - "EndpointProvisioningState", - "EnvironmentType", - "EnvironmentVariableType", - "ExportFormatType", - "FeatureDataType", - "FeatureLags", - "FeaturestoreJobType", - "FeaturizationMode", - "ForecastHorizonMode", - "ForecastingModels", - "ForecastingPrimaryMetrics", - "Goal", - "IdentityConfigurationType", - "ImageAnnotationType", - "ImageType", - "IncrementalDataRefresh", - "InferencingServerType", - "InputDeliveryMode", - "InputPathType", - "InstanceSegmentationPrimaryMetrics", - "JobInputType", - "JobLimitsType", - "JobOutputType", - "JobProvisioningState", - "JobStatus", - "JobTier", - "JobType", - "KeyType", - "LearningRateScheduler", - "ListViewType", - "LoadBalancerType", - "LogVerbosity", - "MLAssistConfigurationType", - "MLFlowAutologgerState", - "ManagedServiceIdentityType", - "MaterializationStoreType", - "MediaType", - "MlflowAutologger", - "ModelSize", - "MountAction", - "MountState", - "MultiSelect", - "NCrossValidationsMode", - "Network", - "NlpLearningRateScheduler", - "NodeState", - "NodesValueType", - "ObjectDetectionPrimaryMetrics", - "OperatingSystemType", - "OperationName", - "OperationStatus", - "OperationTrigger", - "OrderString", - "OsType", - "OutputDeliveryMode", - "PackageBuildState", - "PackageInputDeliveryMode", - "PackageInputType", - "PrivateEndpointConnectionProvisioningState", - "PrivateEndpointServiceConnectionStatus", - "Protocol", - "ProvisioningState", - "ProvisioningStatus", - "PublicNetworkAccess", - "PublicNetworkAccessType", - "QuotaUnit", - "RandomSamplingAlgorithmRule", - "RecurrenceFrequency", - "ReferenceType", - "RegressionModels", - "RegressionPrimaryMetrics", - "RemoteLoginPortPublicAccess", - "SamplingAlgorithmType", - "ScaleType", - "ScheduleActionType", - "ScheduleListViewType", - "ScheduleProvisioningState", - "ScheduleProvisioningStatus", - "ScheduleStatus", - "SeasonalityMode", - "SecretsType", - "ServiceDataAccessAuthIdentity", - "ShortSeriesHandlingConfiguration", - "SkuScaleType", - "SkuTier", - "SourceType", - "SparkJobEntryType", - "SshPublicAccess", - "SslConfigStatus", - "StackMetaLearnerType", - "Status", - "StatusMessageLevel", - "StochasticOptimizer", - "StorageAccountType", - "TargetAggregationFunction", - "TargetLagsMode", - "TargetRollingWindowSizeMode", - "TaskType", - "TextAnnotationType", - "TrainingMode", - "TriggerType", - "UnderlyingResourceAction", - "UnitOfMeasure", - "UsageUnit", - "UseStl", - "VMPriceOSType", - "VMTier", - "ValidationMetricType", - "ValueFormat", - "VmPriority", - "VolumeDefinitionType", - "WeekDay", -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_azure_machine_learning_workspaces_enums.py deleted file mode 100644 index 6dfca11ed77c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_azure_machine_learning_workspaces_enums.py +++ /dev/null @@ -1,1653 +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 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 AssetProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Provisioning state of registry asset.""" - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - - -class AutoRebuildSetting(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AutoRebuild setting for the derived image""" - - DISABLED = "Disabled" - ON_BASE_IMAGE_UPDATE = "OnBaseImageUpdate" - - -class Autosave(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Auto save settings.""" - - NONE = "None" - LOCAL = "Local" - REMOTE = "Remote" - - -class BaseEnvironmentSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Base environment type.""" - - ENVIRONMENT_ASSET = "EnvironmentAsset" - - -class BatchDeploymentPropertyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The enumerated property types for batch deployments.""" - - MODEL = "Model" - PIPELINE_COMPONENT = "PipelineComponent" - - -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 BillingCurrency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Three lettered code specifying the currency of the VM price. Example: USD""" - - USD = "USD" - - -class BlockedTransformers(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """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(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Caching type of Data Disk.""" - - NONE = "None" - READ_ONLY = "ReadOnly" - READ_WRITE = "ReadWrite" - - -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 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): - """[Required] 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" - ACCESS_KEY = "AccessKey" - - -class ConnectionCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Category of the connection""" - - PYTHON_FEED = "PythonFeed" - CONTAINER_REGISTRY = "ContainerRegistry" - GIT = "Git" - FEATURE_STORE = "FeatureStore" - S3 = "S3" - SNOWFLAKE = "Snowflake" - AZURE_SQL_DB = "AzureSqlDb" - AZURE_SYNAPSE_ANALYTICS = "AzureSynapseAnalytics" - - -class ContainerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of container to retrieve logs from.""" - - #: The container used to download models and score script. - STORAGE_INITIALIZER = "StorageInitializer" - #: The container used to serve user's request. - INFERENCE_SERVER = "InferenceServer" - #: The container used to collect payload and custom logging when mdc is enabled. - MODEL_DATA_COLLECTOR = "ModelDataCollector" - - -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 = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "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 DiagnoseResultLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level of workspace setup error""" - - WARNING = "Warning" - ERROR = "Error" - INFORMATION = "Information" - - -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 EmailNotificationEnableType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the email notification type.""" - - JOB_COMPLETED = "JobCompleted" - JOB_FAILED = "JobFailed" - JOB_CANCELLED = "JobCancelled" - - -class EncryptionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether or not the encryption is enabled for the workspace.""" - - 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 EnvironmentVariableType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the Environment Variable. Possible values are: local - For local variable""" - - LOCAL = "local" - - -class ExportFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The format of exported labels.""" - - DATASET = "Dataset" - COCO = "Coco" - CSV = "CSV" - - -class FeatureDataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - STRING = "String" - INTEGER = "Integer" - LONG = "Long" - FLOAT = "Float" - DOUBLE = "Double" - BINARY = "Binary" - DATETIME = "Datetime" - BOOLEAN = "Boolean" - - -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 FeaturestoreJobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - RECURRENT_MATERIALIZATION = "RecurrentMaterialization" - BACKFILL_MATERIALIZATION = "BackfillMaterialization" - - -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 ImageAnnotationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Annotation type of image data.""" - - CLASSIFICATION = "Classification" - BOUNDING_BOX = "BoundingBox" - INSTANCE_SEGMENTATION = "InstanceSegmentation" - - -class ImageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the image. Possible values are: docker - For docker images. azureml - For AzureML - images - """ - - DOCKER = "docker" - AZUREML = "azureml" - - -class IncrementalDataRefresh(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether IncrementalDataRefresh is enabled""" - - ENABLED = "Enabled" - DISABLED = "Disabled" - - -class InferencingServerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Inferencing server type for various targets.""" - - AZURE_ML_ONLINE = "AzureMLOnline" - AZURE_ML_BATCH = "AzureMLBatch" - TRITON = "Triton" - CUSTOM = "Custom" - - -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 InputPathType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Input path type for package inputs.""" - - URL = "Url" - PATH_ID = "PathId" - PATH_VERSION = "PathVersion" - - -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 = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - CUSTOM_MODEL = "custom_model" - MLFLOW_MODEL = "mlflow_model" - TRITON_MODEL = "triton_model" - - -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 = "uri_file" - URI_FOLDER = "uri_folder" - MLTABLE = "mltable" - CUSTOM_MODEL = "custom_model" - MLFLOW_MODEL = "mlflow_model" - TRITON_MODEL = "triton_model" - - -class JobProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the job provisioning state.""" - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - IN_PROGRESS = "InProgress" - - -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 JobTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the job tier.""" - - SPOT = "Spot" - BASIC = "Basic" - STANDARD = "Standard" - PREMIUM = "Premium" - - -class JobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of job.""" - - AUTO_ML = "AutoML" - COMMAND = "Command" - LABELING = "Labeling" - SWEEP = "Sweep" - PIPELINE = "Pipeline" - SPARK = "Spark" - - -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 LoadBalancerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Load Balancer Type""" - - PUBLIC_IP = "PublicIp" - INTERNAL_LOAD_BALANCER = "InternalLoadBalancer" - - -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 MaterializationStoreType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - NONE = "None" - ONLINE = "Online" - OFFLINE = "Offline" - ONLINE_AND_OFFLINE = "OnlineAndOffline" - - -class MediaType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Media type of data asset.""" - - IMAGE = "Image" - TEXT = "Text" - - -class MLAssistConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - ENABLED = "Enabled" - DISABLED = "Disabled" - - -class MlflowAutologger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether mlflow autologger is enabled for notebooks.""" - - ENABLED = "Enabled" - DISABLED = "Disabled" - - -class MLFlowAutologgerState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the state of mlflow autologger.""" - - ENABLED = "Enabled" - DISABLED = "Disabled" - - -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 MountAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount Action.""" - - MOUNT = "Mount" - UNMOUNT = "Unmount" - - -class MountState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount state.""" - - MOUNT_REQUESTED = "MountRequested" - MOUNTED = "Mounted" - MOUNT_FAILED = "MountFailed" - UNMOUNT_REQUESTED = "UnmountRequested" - UNMOUNT_FAILED = "UnmountFailed" - UNMOUNTED = "Unmounted" - - -class MultiSelect(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether multiSelect is enabled""" - - ENABLED = "Enabled" - DISABLED = "Disabled" - - -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 Network(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """network of this container.""" - - BRIDGE = "Bridge" - HOST = "Host" - - -class NlpLearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum of learning rate schedulers that aligns with those supported by HF""" - - #: No learning rate schedule. - NONE = "None" - #: Linear warmup and decay. - LINEAR = "Linear" - #: Linear warmup then cosine decay. - COSINE = "Cosine" - #: Linear warmup, cosine decay, then restart to initial LR. - COSINE_WITH_RESTARTS = "CosineWithRestarts" - #: Increase linearly then polynomially decay. - POLYNOMIAL = "Polynomial" - #: Constant learning rate. - CONSTANT = "Constant" - #: Linear warmup followed by constant value. - CONSTANT_WITH_WARMUP = "ConstantWithWarmup" - - -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 NodesValueType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The enumerated types for the nodes value""" - - ALL = "All" - 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 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 OperationTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Trigger of operation.""" - - USER = "User" - SCHEDULE = "Schedule" - IDLE_SHUTDOWN = "IdleShutdown" - - -class OrderString(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - CREATED_AT_DESC = "CreatedAtDesc" - CREATED_AT_ASC = "CreatedAtAsc" - UPDATED_AT_DESC = "UpdatedAtDesc" - UPDATED_AT_ASC = "UpdatedAtAsc" - - -class OsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Compute OS Type""" - - LINUX = "Linux" - WINDOWS = "Windows" - - -class OutputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Output data delivery mode enums.""" - - READ_WRITE_MOUNT = "ReadWriteMount" - UPLOAD = "Upload" - DIRECT = "Direct" - - -class PackageBuildState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Package build state returned in package response.""" - - NOT_STARTED = "NotStarted" - RUNNING = "Running" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - - -class PackageInputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mounting type of the model or the inputs""" - - READ_ONLY_MOUNT = "ReadOnlyMount" - DOWNLOAD = "Download" - - -class PackageInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the inputs.""" - - URI_FILE = "UriFile" - URI_FOLDER = "UriFolder" - - -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 Protocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Protocol over which communication will happen over this endpoint""" - - TCP = "tcp" - UDP = "udp" - HTTP = "http" - - -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" - SOFT_DELETED = "SoftDeleted" - - -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 PublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled.""" - - ENABLED = "Enabled" - DISABLED = "Disabled" - - -class QuotaUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of quota measurement.""" - - COUNT = "Count" - - -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 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 SamplingAlgorithmType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - GRID = "Grid" - RANDOM = "Random" - BAYESIAN = "Bayesian" - - -class ScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - DEFAULT = "Default" - TARGET_UTILIZATION = "TargetUtilization" - - -class ScheduleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - CREATE_JOB = "CreateJob" - INVOKE_BATCH_ENDPOINT = "InvokeBatchEndpoint" - - -class ScheduleListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - ENABLED_ONLY = "EnabledOnly" - DISABLED_ONLY = "DisabledOnly" - ALL = "All" - - -class ScheduleProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current deployment state of schedule.""" - - COMPLETED = "Completed" - PROVISIONING = "Provisioning" - FAILED = "Failed" - - -class ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - - -class ScheduleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Is the schedule enabled or disabled?""" - - ENABLED = "Enabled" - DISABLED = "Disabled" - - -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 SourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Data source type.""" - - DATASET = "Dataset" - DATASTORE = "Datastore" - URI = "URI" - - -class SparkJobEntryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - SPARK_JOB_PYTHON_ENTRY = "SparkJobPythonEntry" - SPARK_JOB_SCALA_ENTRY = "SparkJobScalaEntry" - - -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 SslConfigStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enable or disable ssl for scoring""" - - DISABLED = "Disabled" - ENABLED = "Enabled" - 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" - #: 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(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 StatusMessageLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - ERROR = "Error" - INFORMATION = "Information" - WARNING = "Warning" - - -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 StorageAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """type of this storage account.""" - - STANDARD_LRS = "Standard_LRS" - PREMIUM_LRS = "Premium_LRS" - - -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 TextAnnotationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Annotation type of text data.""" - - CLASSIFICATION = "Classification" - NAMED_ENTITY_RECOGNITION = "NamedEntityRecognition" - - -class TrainingMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Training mode dictates whether to use distributed training or not""" - - #: Auto mode. - AUTO = "Auto" - #: Distributed training mode. - DISTRIBUTED = "Distributed" - #: Non distributed training mode. - NON_DISTRIBUTED = "NonDistributed" - - -class TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - - 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 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 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" - - -class VolumeDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe""" - - BIND = "bind" - VOLUME = "volume" - TMPFS = "tmpfs" - NPIPE = "npipe" - - -class WeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """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/v2023_02_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_models.py deleted file mode 100644 index b4e41749877c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_models.py +++ /dev/null @@ -1,24259 +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: AccessKeyAuthTypeWorkspaceConnectionProperties, 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 - """ - - _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"}, - } - - _subtype_map = { - "auth_type": { - "AccessKey": "AccessKeyAuthTypeWorkspaceConnectionProperties", - "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", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 - """ - 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) - - -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """AccessKeyAuthTypeWorkspaceConnectionProperties. - - 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - - _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"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionAccessKey"}, - } - - def __init__(self, **kwargs): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 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 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 AcrDetails(msrest.serialization.Model): - """Details of ACR account to be used for the Registry. - - :ivar system_created_acr_account: - :vartype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :ivar user_created_acr_account: - :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: - :paramtype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :keyword user_created_acr_account: - :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", "SoftDeleted". - :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", "SoftDeleted". - :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 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", "Custom". - :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", "Custom". - :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", "SoftDeleted". - :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 AmlOperation(msrest.serialization.Model): - """Azure Machine Learning 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.AmlOperationDisplay - :ivar is_data_action: Indicates whether the operation applies to data-plane. - :vartype is_data_action: bool - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display": {"key": "display", "type": "AmlOperationDisplay"}, - "is_data_action": {"key": "isDataAction", "type": "bool"}, - } - - 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.AmlOperationDisplay - :keyword is_data_action: Indicates whether the operation applies to data-plane. - :paramtype is_data_action: bool - """ - super(AmlOperation, self).__init__(**kwargs) - self.name = kwargs.get("name", None) - self.display = kwargs.get("display", None) - self.is_data_action = kwargs.get("is_data_action", None) - - -class AmlOperationDisplay(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(AmlOperationDisplay, 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 AmlOperationListResult(msrest.serialization.Model): - """An array of operations supported by the resource provider. - - :ivar value: List of AML operations supported by the AML resource provider. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] - """ - - _attribute_map = { - "value": {"key": "value", "type": "[AmlOperation]"}, - } - - def __init__(self, **kwargs): - """ - :keyword value: List of AML operations supported by the AML resource provider. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] - """ - super(AmlOperationListResult, self).__init__(**kwargs) - self.value = kwargs.get("value", 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 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 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, "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 asset_version: Output Asset Version. - :vartype asset_version: 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"}, - "asset_version": {"key": "assetVersion", "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 asset_version: Output Asset Version. - :paramtype asset_version: 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.asset_version = kwargs.get("asset_version", 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 AutologgerSettings(msrest.serialization.Model): - """Settings for Autologger. - - All required parameters must be populated in order to send to Azure. - - :ivar mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is enabled. - Possible values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - - _validation = { - "mlflow_autologger": {"required": True}, - } - - _attribute_map = { - "mlflow_autologger": {"key": "mlflowAutologger", "type": "str"}, - } - - def __init__(self, **kwargs): - """ - :keyword mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is - enabled. Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - super(AutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = kwargs["mlflow_autologger"] - - -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, LabelingJobProperties, 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", "Labeling", "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", "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}"}, - "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", - "Labeling": "LabelingJobProperties", - "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", "Labeling", "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", "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 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, 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(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", "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 = { - "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", "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 = { - "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", "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 = { - "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 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", "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 = { - "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 InferencingServer(msrest.serialization.Model): - """InferencingServer. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureMLBatchInferencingServer, AzureMLOnlineInferencingServer, CustomInferencingServer, TritonInferencingServer. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - """ - - _validation = { - "server_type": {"required": True}, - } - - _attribute_map = { - "server_type": {"key": "serverType", "type": "str"}, - } - - _subtype_map = { - "server_type": { - "AzureMLBatch": "AzureMLBatchInferencingServer", - "AzureMLOnline": "AzureMLOnlineInferencingServer", - "Custom": "CustomInferencingServer", - "Triton": "TritonInferencingServer", - } - } - - def __init__(self, **kwargs): - """ """ - super(InferencingServer, self).__init__(**kwargs) - self.server_type = None # type: Optional[str] - - -class AzureMLBatchInferencingServer(InferencingServer): - """Azure ML batch inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML batch inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - "server_type": {"required": True}, - } - - _attribute_map = { - "server_type": {"key": "serverType", "type": "str"}, - "code_configuration": {"key": "codeConfiguration", "type": "CodeConfiguration"}, - } - - def __init__(self, **kwargs): - """ - :keyword code_configuration: Code configuration for AML batch inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLBatchInferencingServer, self).__init__(**kwargs) - self.server_type = "AzureMLBatch" # type: str - self.code_configuration = kwargs.get("code_configuration", None) - - -class AzureMLOnlineInferencingServer(InferencingServer): - """Azure ML online inferencing configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - "server_type": {"required": True}, - } - - _attribute_map = { - "server_type": {"key": "serverType", "type": "str"}, - "code_configuration": {"key": "codeConfiguration", "type": "CodeConfiguration"}, - } - - def __init__(self, **kwargs): - """ - :keyword code_configuration: Code configuration for AML inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLOnlineInferencingServer, self).__init__(**kwargs) - self.server_type = "AzureMLOnline" # type: str - self.code_configuration = kwargs.get("code_configuration", 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 BaseEnvironmentSource(msrest.serialization.Model): - """BaseEnvironmentSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BaseEnvironmentId. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - """ - - _validation = { - "base_environment_source_type": {"required": True}, - } - - _attribute_map = { - "base_environment_source_type": {"key": "baseEnvironmentSourceType", "type": "str"}, - } - - _subtype_map = {"base_environment_source_type": {"EnvironmentAsset": "BaseEnvironmentId"}} - - def __init__(self, **kwargs): - """ """ - super(BaseEnvironmentSource, self).__init__(**kwargs) - self.base_environment_source_type = None # type: Optional[str] - - -class BaseEnvironmentId(BaseEnvironmentSource): - """Base environment type. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - :ivar resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :vartype resource_id: str - """ - - _validation = { - "base_environment_source_type": {"required": True}, - "resource_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, - } - - _attribute_map = { - "base_environment_source_type": {"key": "baseEnvironmentSourceType", "type": "str"}, - "resource_id": {"key": "resourceId", "type": "str"}, - } - - def __init__(self, **kwargs): - """ - :keyword resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :paramtype resource_id: str - """ - super(BaseEnvironmentId, self).__init__(**kwargs) - self.base_environment_source_type = "EnvironmentAsset" # type: str - self.resource_id = kwargs["resource_id"] - - -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 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 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 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_properties: Properties relevant to different deployment types. - :vartype deployment_properties: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentPropertiesAutoGenerated - :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_properties": {"key": "deploymentProperties", "type": "BatchDeploymentPropertiesAutoGenerated"}, - "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 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_properties: Properties relevant to different deployment types. - :paramtype deployment_properties: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentPropertiesAutoGenerated - :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_properties = kwargs.get("deployment_properties", 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 BatchDeploymentPropertiesAutoGenerated(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: BatchPipelineComponentDeploymentProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_property_type: Required. [Required] The type of the deployment.Constant filled - by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_property_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentPropertyType - """ - - _validation = { - "deployment_property_type": {"required": True}, - } - - _attribute_map = { - "deployment_property_type": {"key": "deploymentPropertyType", "type": "str"}, - } - - _subtype_map = {"deployment_property_type": {"PipelineComponent": "BatchPipelineComponentDeploymentProperties"}} - - def __init__(self, **kwargs): - """ """ - super(BatchDeploymentPropertiesAutoGenerated, self).__init__(**kwargs) - self.deployment_property_type = None # type: Optional[str] - - -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 BatchPipelineComponentDeploymentProperties(BatchDeploymentPropertiesAutoGenerated): - """Properties for a Batch Pipeline Component Deployment. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_property_type: Required. [Required] The type of the deployment.Constant filled - by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_property_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentPropertyType - :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_property_type": {"required": True}, - } - - _attribute_map = { - "deployment_property_type": {"key": "deploymentPropertyType", "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(BatchPipelineComponentDeploymentProperties, self).__init__(**kwargs) - self.deployment_property_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 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 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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"}, - "fixed_parameters": {"key": "fixedParameters", "type": "TableFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "TableVerticalLimitSettings"}, - "n_cross_validations": {"key": "nCrossValidations", "type": "NCrossValidations"}, - "search_space": {"key": "searchSpace", "type": "[TableParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "TableSweepSettings"}, - "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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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.fixed_parameters = kwargs.get("fixed_parameters", None) - self.limit_settings = kwargs.get("limit_settings", None) - self.n_cross_validations = kwargs.get("n_cross_validations", None) - self.search_space = kwargs.get("search_space", None) - self.sweep_settings = kwargs.get("sweep_settings", 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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"}, - "fixed_parameters": {"key": "fixedParameters", "type": "TableFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "TableVerticalLimitSettings"}, - "n_cross_validations": {"key": "nCrossValidations", "type": "NCrossValidations"}, - "search_space": {"key": "searchSpace", "type": "[TableParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "TableSweepSettings"}, - "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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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.fixed_parameters = kwargs.get("fixed_parameters", None) - self.limit_settings = kwargs.get("limit_settings", None) - self.n_cross_validations = kwargs.get("n_cross_validations", None) - self.search_space = kwargs.get("search_space", None) - self.sweep_settings = kwargs.get("sweep_settings", 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 - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - - _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"}, - "training_mode": {"key": "trainingMode", "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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - 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) - self.training_mode = kwargs.get("training_mode", 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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"}, - "training_mode": {"key": "trainingMode", "type": "str"}, - "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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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 ExportSummary(msrest.serialization.Model): - """ExportSummary. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CsvExportSummary, CocoExportSummary, DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - """ - - _validation = { - "end_date_time": {"readonly": True}, - "exported_row_count": {"readonly": True}, - "format": {"required": True}, - "labeling_job_id": {"readonly": True}, - "start_date_time": {"readonly": True}, - } - - _attribute_map = { - "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, - "exported_row_count": {"key": "exportedRowCount", "type": "long"}, - "format": {"key": "format", "type": "str"}, - "labeling_job_id": {"key": "labelingJobId", "type": "str"}, - "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, - } - - _subtype_map = { - "format": {"CSV": "CsvExportSummary", "Coco": "CocoExportSummary", "Dataset": "DatasetExportSummary"} - } - - def __init__(self, **kwargs): - """ """ - super(ExportSummary, self).__init__(**kwargs) - self.end_date_time = None - self.exported_row_count = None - self.format = None # type: Optional[str] - self.labeling_job_id = None - self.start_date_time = None - - -class CocoExportSummary(ExportSummary): - """CocoExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - "end_date_time": {"readonly": True}, - "exported_row_count": {"readonly": True}, - "format": {"required": True}, - "labeling_job_id": {"readonly": True}, - "start_date_time": {"readonly": True}, - "container_name": {"readonly": True}, - "snapshot_path": {"readonly": True}, - } - - _attribute_map = { - "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, - "exported_row_count": {"key": "exportedRowCount", "type": "long"}, - "format": {"key": "format", "type": "str"}, - "labeling_job_id": {"key": "labelingJobId", "type": "str"}, - "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, - "container_name": {"key": "containerName", "type": "str"}, - "snapshot_path": {"key": "snapshotPath", "type": "str"}, - } - - def __init__(self, **kwargs): - """ """ - super(CocoExportSummary, self).__init__(**kwargs) - self.format = "Coco" # type: str - self.container_name = None - self.snapshot_path = 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(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.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(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.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 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", "Labeling", "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", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar autologger_settings: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :vartype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :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, "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"}, - "autologger_settings": {"key": "autologgerSettings", "type": "AutologgerSettings"}, - "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 autologger_settings: Distribution configuration of the job. If set, this should be one - of Mpi, Tensorflow, PyTorch, or null. - :paramtype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :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.autologger_settings = kwargs.get("autologger_settings", None) - 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(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.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(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.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", "SoftDeleted". - :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 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"}, - "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 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.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", "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 - :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", "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 - :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", "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 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"}, - "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 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.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 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 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.TriggerType - :ivar recurrence: Required if triggerType is Recurrence. - :vartype recurrence: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :ivar cron: Required if triggerType is Cron. - :vartype cron: ~azure.mgmt.machinelearningservices.models.CronTrigger - :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": "RecurrenceTrigger"}, - "cron": {"key": "cron", "type": "CronTrigger"}, - "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.TriggerType - :keyword recurrence: Required if triggerType is Recurrence. - :paramtype recurrence: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :keyword cron: Required if triggerType is Cron. - :paramtype cron: ~azure.mgmt.machinelearningservices.models.CronTrigger - :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 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 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, "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 CsvExportSummary(ExportSummary): - """CsvExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - "end_date_time": {"readonly": True}, - "exported_row_count": {"readonly": True}, - "format": {"required": True}, - "labeling_job_id": {"readonly": True}, - "start_date_time": {"readonly": True}, - "container_name": {"readonly": True}, - "snapshot_path": {"readonly": True}, - } - - _attribute_map = { - "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, - "exported_row_count": {"key": "exportedRowCount", "type": "long"}, - "format": {"key": "format", "type": "str"}, - "labeling_job_id": {"key": "labelingJobId", "type": "str"}, - "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, - "container_name": {"key": "containerName", "type": "str"}, - "snapshot_path": {"key": "snapshotPath", "type": "str"}, - } - - def __init__(self, **kwargs): - """ """ - super(CsvExportSummary, self).__init__(**kwargs) - self.format = "CSV" # type: str - self.container_name = None - self.snapshot_path = None - - -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 CustomInferencingServer(InferencingServer): - """Custom inference server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for custom inferencing. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - "server_type": {"required": True}, - } - - _attribute_map = { - "server_type": {"key": "serverType", "type": "str"}, - "inference_configuration": {"key": "inferenceConfiguration", "type": "OnlineInferenceConfiguration"}, - } - - def __init__(self, **kwargs): - """ - :keyword inference_configuration: Inference configuration for custom inferencing. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(CustomInferencingServer, self).__init__(**kwargs) - self.server_type = "Custom" # type: str - self.inference_configuration = kwargs.get("inference_configuration", 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, "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 asset_version: Output Asset Version. - :vartype asset_version: 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"}, - "asset_version": {"key": "assetVersion", "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 asset_version: Output Asset Version. - :paramtype asset_version: 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.asset_version = kwargs.get("asset_version", 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 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] - """ - - _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]"}, - } - - 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] - """ - 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) - - -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", "SoftDeleted". - :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 DataContainer(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.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 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", "SoftDeleted". - :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", "SoftDeleted". - :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 DatasetExportSummary(ExportSummary): - """DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar labeled_asset_name: The unique name of the labeled data asset. - :vartype labeled_asset_name: str - """ - - _validation = { - "end_date_time": {"readonly": True}, - "exported_row_count": {"readonly": True}, - "format": {"required": True}, - "labeling_job_id": {"readonly": True}, - "start_date_time": {"readonly": True}, - "labeled_asset_name": {"readonly": True}, - } - - _attribute_map = { - "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, - "exported_row_count": {"key": "exportedRowCount", "type": "long"}, - "format": {"key": "format", "type": "str"}, - "labeling_job_id": {"key": "labelingJobId", "type": "str"}, - "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, - "labeled_asset_name": {"key": "labeledAssetName", "type": "str"}, - } - - def __init__(self, **kwargs): - """ """ - super(DatasetExportSummary, self).__init__(**kwargs) - self.format = "Dataset" # type: str - self.labeled_asset_name = None - - -class Datastore(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.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(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.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, "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", "ModelDataCollector". - :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", "ModelDataCollector". - :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 locations: Locations where the job can run. - :vartype locations: list[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"}, - "locations": {"key": "locations", "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 locations: Locations where the job can run. - :paramtype locations: list[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.locations = kwargs.get("locations", 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 locations: Locations where the job can run. - :vartype locations: list[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"}, - "locations": {"key": "locations", "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 locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(DeploymentResourceConfiguration, self).__init__(**kwargs) - - -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 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 EncryptionKeyVaultProperties(msrest.serialization.Model): - """EncryptionKeyVaultProperties. - - 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(EncryptionKeyVaultProperties, 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 EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): - """EncryptionKeyVaultUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_identifier: Required. Key Vault uri to access the encryption key. - :vartype key_identifier: str - """ - - _validation = { - "key_identifier": {"required": True}, - } - - _attribute_map = { - "key_identifier": {"key": "keyIdentifier", "type": "str"}, - } - - def __init__(self, **kwargs): - """ - :keyword key_identifier: Required. Key Vault uri to access the encryption key. - :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 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.EncryptionKeyVaultProperties - """ - - _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": "EncryptionKeyVaultProperties"}, - } - - 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.EncryptionKeyVaultProperties - """ - super(EncryptionProperty, self).__init__(**kwargs) - self.status = kwargs["status"] - self.identity = kwargs.get("identity", None) - self.key_vault_properties = kwargs["key_vault_properties"] - - -class EncryptionUpdateProperties(msrest.serialization.Model): - """EncryptionUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_vault_properties: Required. Customer Key vault properties. - :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. Customer Key vault properties. - :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 ScheduleActionBase(msrest.serialization.Model): - """ScheduleActionBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobScheduleAction, 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". - :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", "InvokeBatchEndpoint": "EndpointScheduleAction"}} - - def __init__(self, **kwargs): - """ """ - super(ScheduleActionBase, self).__init__(**kwargs) - self.action_type = None # type: Optional[str] - - -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". - :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(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.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(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.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 - """ - - _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"}, - } - - 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 - """ - 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 - - -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.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 Feature(msrest.serialization.Model): - """Dto object representing feature. - - :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 description: Specifies description. - :vartype description: str - :ivar feature_name: Specifies name. - :vartype feature_name: str - :ivar tags: A set of tags. Specifies tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - "data_type": {"key": "dataType", "type": "str"}, - "description": {"key": "description", "type": "str"}, - "feature_name": {"key": "featureName", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__(self, **kwargs): - """ - :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 description: Specifies description. - :paramtype description: str - :keyword feature_name: Specifies name. - :paramtype feature_name: str - :keyword tags: A set of tags. Specifies tags. - :paramtype tags: dict[str, str] - """ - super(Feature, self).__init__(**kwargs) - self.data_type = kwargs.get("data_type", None) - self.description = kwargs.get("description", None) - self.feature_name = kwargs.get("feature_name", None) - self.tags = kwargs.get("tags", None) - - -class FeatureArmPaginatedResult(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(FeatureArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get("next_link", None) - self.value = kwargs.get("value", None) - - -class FeaturesetContainer(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.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 FeaturesetJob(msrest.serialization.Model): - """Dto object representing the feature set job. - - :ivar created_date: Specifies the created date. - :vartype created_date: ~datetime.datetime - :ivar display_name: Specifies the display name. - :vartype display_name: str - :ivar duration: Specifies the duration. - :vartype duration: ~datetime.timedelta - :ivar experiment_id: Specifies the experiment id. - :vartype experiment_id: str - :ivar feature_window: Specifies the backfill feature window to be materialized. - :vartype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :ivar job_id: Specifies the job id. - :vartype job_id: str - :ivar status: Specifies the job status. 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 tags: A set of tags. Specifies the tags if any. - :vartype tags: dict[str, str] - :ivar type: Specifies the feature store job type. Possible values include: - "RecurrentMaterialization", "BackfillMaterialization". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.FeaturestoreJobType - """ - - _attribute_map = { - "created_date": {"key": "createdDate", "type": "iso-8601"}, - "display_name": {"key": "displayName", "type": "str"}, - "duration": {"key": "duration", "type": "duration"}, - "experiment_id": {"key": "experimentId", "type": "str"}, - "feature_window": {"key": "featureWindow", "type": "FeatureWindow"}, - "job_id": {"key": "jobId", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, **kwargs): - """ - :keyword created_date: Specifies the created date. - :paramtype created_date: ~datetime.datetime - :keyword display_name: Specifies the display name. - :paramtype display_name: str - :keyword duration: Specifies the duration. - :paramtype duration: ~datetime.timedelta - :keyword experiment_id: Specifies the experiment id. - :paramtype experiment_id: str - :keyword feature_window: Specifies the backfill feature window to be materialized. - :paramtype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :keyword job_id: Specifies the job id. - :paramtype job_id: str - :keyword status: Specifies the job status. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :keyword tags: A set of tags. Specifies the tags if any. - :paramtype tags: dict[str, str] - :keyword type: Specifies the feature store job type. Possible values include: - "RecurrentMaterialization", "BackfillMaterialization". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.FeaturestoreJobType - """ - super(FeaturesetJob, self).__init__(**kwargs) - self.created_date = kwargs.get("created_date", None) - self.display_name = kwargs.get("display_name", None) - self.duration = kwargs.get("duration", None) - self.experiment_id = kwargs.get("experiment_id", None) - self.feature_window = kwargs.get("feature_window", None) - self.job_id = kwargs.get("job_id", None) - self.status = kwargs.get("status", None) - self.tags = kwargs.get("tags", None) - self.type = kwargs.get("type", None) - - -class FeaturesetJobArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetJob entities. - - :ivar next_link: The link to the next page of FeaturesetJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetJob] - """ - - _attribute_map = { - "next_link": {"key": "nextLink", "type": "str"}, - "value": {"key": "value", "type": "[FeaturesetJob]"}, - } - - def __init__(self, **kwargs): - """ - :keyword next_link: The link to the next page of FeaturesetJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetJob] - """ - super(FeaturesetJobArmPaginatedResult, 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(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.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 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 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 = { - "description": {"key": "description", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "feature_window": {"key": "featureWindow", "type": "FeatureWindow"}, - "resource": {"key": "resource", "type": "MaterializationComputeResource"}, - "spark_configuration": {"key": "sparkConfiguration", "type": "{str}"}, - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__(self, **kwargs): - """ - :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 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.description = kwargs.get("description", None) - self.display_name = kwargs.get("display_name", None) - self.feature_window = kwargs.get("feature_window", 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_id: Job id created as part of request. - :vartype job_id: str - """ - - _attribute_map = { - "job_id": {"key": "jobId", "type": "str"}, - } - - def __init__(self, **kwargs): - """ - :keyword job_id: Job id created as part of request. - :paramtype job_id: str - """ - super(FeaturesetVersionBackfillResponse, self).__init__(**kwargs) - self.job_id = kwargs.get("job_id", 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(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.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(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.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 - """ - - _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"}, - } - - 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] - """ - super(FeaturestoreEntityVersionProperties, self).__init__(**kwargs) - self.index_columns = kwargs.get("index_columns", None) - self.provisioning_state = 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 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 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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"}, - "fixed_parameters": {"key": "fixedParameters", "type": "TableFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "TableVerticalLimitSettings"}, - "n_cross_validations": {"key": "nCrossValidations", "type": "NCrossValidations"}, - "search_space": {"key": "searchSpace", "type": "[TableParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "TableSweepSettings"}, - "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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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.fixed_parameters = kwargs.get("fixed_parameters", None) - self.limit_settings = kwargs.get("limit_settings", None) - self.n_cross_validations = kwargs.get("n_cross_validations", None) - self.search_space = kwargs.get("search_space", None) - self.sweep_settings = kwargs.get("sweep_settings", 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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"}, - "training_mode": {"key": "trainingMode", "type": "str"}, - "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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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 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 GetFeatureRequest(msrest.serialization.Model): - """Request payload to retrieve feature information from a given feature set version. - - :ivar feature_name: Specifies name of the feature. - :vartype feature_name: str - """ - - _attribute_map = { - "feature_name": {"key": "featureName", "type": "str"}, - } - - def __init__(self, **kwargs): - """ - :keyword feature_name: Specifies name of the feature. - :paramtype feature_name: str - """ - super(GetFeatureRequest, self).__init__(**kwargs) - self.feature_name = kwargs.get("feature_name", 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(DatastoreProperties): - """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 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", "SoftDeleted". - :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, "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 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 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 images. Possible values include: "docker", "azureml". Default value: "docker". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :ivar reference: Image reference URL. - :vartype reference: str - """ - - _attribute_map = { - "additional_properties": {"key": "", "type": "{object}"}, - "type": {"key": "type", "type": "str"}, - "reference": {"key": "reference", "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 images. Possible values include: "docker", "azureml". Default value: "docker". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :keyword reference: Image reference URL. - :paramtype reference: 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) - - -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. - - :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 - """ - - _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"}, - } - - 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) - - -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(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.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 locations: Locations where the job can run. - :vartype locations: list[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"}, - "locations": {"key": "locations", "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 locations: Locations where the job can run. - :paramtype locations: list[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". - :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 set by user. - :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 set by user. - :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 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"] - - -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"] - - -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 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", "SoftDeleted". - :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 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 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"}, - "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 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.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 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 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"}, - "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 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 LabelCategory(msrest.serialization.Model): - """Label category definition. - - :ivar classes: Dictionary of label classes in this category. - :vartype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :ivar display_name: Display name of the label category. - :vartype display_name: str - :ivar multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :vartype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - - _attribute_map = { - "classes": {"key": "classes", "type": "{LabelClass}"}, - "display_name": {"key": "displayName", "type": "str"}, - "multi_select": {"key": "multiSelect", "type": "str"}, - } - - def __init__(self, **kwargs): - """ - :keyword classes: Dictionary of label classes in this category. - :paramtype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :keyword display_name: Display name of the label category. - :paramtype display_name: str - :keyword multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :paramtype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - super(LabelCategory, self).__init__(**kwargs) - self.classes = kwargs.get("classes", None) - self.display_name = kwargs.get("display_name", None) - self.multi_select = kwargs.get("multi_select", None) - - -class LabelClass(msrest.serialization.Model): - """Label class definition. - - :ivar display_name: Display name of the label class. - :vartype display_name: str - :ivar subclasses: Dictionary of subclasses of the label class. - :vartype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - - _attribute_map = { - "display_name": {"key": "displayName", "type": "str"}, - "subclasses": {"key": "subclasses", "type": "{LabelClass}"}, - } - - def __init__(self, **kwargs): - """ - :keyword display_name: Display name of the label class. - :paramtype display_name: str - :keyword subclasses: Dictionary of subclasses of the label class. - :paramtype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - super(LabelClass, self).__init__(**kwargs) - self.display_name = kwargs.get("display_name", None) - self.subclasses = kwargs.get("subclasses", None) - - -class LabelingDataConfiguration(msrest.serialization.Model): - """Labeling data configuration definition. - - :ivar data_id: Resource Id of the data asset to perform labeling. - :vartype data_id: str - :ivar incremental_data_refresh: Indicates whether to enable incremental data refresh. Possible - values include: "Enabled", "Disabled". - :vartype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - - _attribute_map = { - "data_id": {"key": "dataId", "type": "str"}, - "incremental_data_refresh": {"key": "incrementalDataRefresh", "type": "str"}, - } - - def __init__(self, **kwargs): - """ - :keyword data_id: Resource Id of the data asset to perform labeling. - :paramtype data_id: str - :keyword incremental_data_refresh: Indicates whether to enable incremental data refresh. - Possible values include: "Enabled", "Disabled". - :paramtype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - super(LabelingDataConfiguration, self).__init__(**kwargs) - self.data_id = kwargs.get("data_id", None) - self.incremental_data_refresh = kwargs.get("incremental_data_refresh", None) - - -class LabelingJob(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.LabelingJobProperties - """ - - _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": "LabelingJobProperties"}, - } - - def __init__(self, **kwargs): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - super(LabelingJob, self).__init__(**kwargs) - self.properties = kwargs["properties"] - - -class LabelingJobMediaProperties(msrest.serialization.Model): - """Properties of a labeling job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LabelingJobImageProperties, LabelingJobTextProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - """ - - _validation = { - "media_type": {"required": True}, - } - - _attribute_map = { - "media_type": {"key": "mediaType", "type": "str"}, - } - - _subtype_map = {"media_type": {"Image": "LabelingJobImageProperties", "Text": "LabelingJobTextProperties"}} - - def __init__(self, **kwargs): - """ """ - super(LabelingJobMediaProperties, self).__init__(**kwargs) - self.media_type = None # type: Optional[str] - - -class LabelingJobImageProperties(LabelingJobMediaProperties): - """Properties of a labeling job for image data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - - _validation = { - "media_type": {"required": True}, - } - - _attribute_map = { - "media_type": {"key": "mediaType", "type": "str"}, - "annotation_type": {"key": "annotationType", "type": "str"}, - } - - def __init__(self, **kwargs): - """ - :keyword annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - super(LabelingJobImageProperties, self).__init__(**kwargs) - self.media_type = "Image" # type: str - self.annotation_type = kwargs.get("annotation_type", None) - - -class LabelingJobInstructions(msrest.serialization.Model): - """Instructions for labeling job. - - :ivar uri: The link to a page with detailed labeling instructions for labelers. - :vartype uri: str - """ - - _attribute_map = { - "uri": {"key": "uri", "type": "str"}, - } - - def __init__(self, **kwargs): - """ - :keyword uri: The link to a page with detailed labeling instructions for labelers. - :paramtype uri: str - """ - super(LabelingJobInstructions, self).__init__(**kwargs) - self.uri = kwargs.get("uri", None) - - -class LabelingJobProperties(JobBaseProperties): - """Labeling 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", "Labeling", "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", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar created_date_time: Created time of the job in UTC timezone. - :vartype created_date_time: ~datetime.datetime - :ivar data_configuration: Configuration of data used in the job. - :vartype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :ivar job_instructions: Labeling instructions of the job. - :vartype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :ivar label_categories: Label categories of the job. - :vartype label_categories: dict[str, ~azure.mgmt.machinelearningservices.models.LabelCategory] - :ivar labeling_job_media_properties: Media type specific properties in the job. - :vartype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :ivar ml_assist_configuration: Configuration of MLAssist feature in the job. - :vartype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - :ivar progress_metrics: Progress metrics of the job. - :vartype progress_metrics: ~azure.mgmt.machinelearningservices.models.ProgressMetrics - :ivar project_id: Internal id of the job(Previously called project). - :vartype project_id: str - :ivar provisioning_state: Specifies the labeling job provisioning state. Possible values - include: "Succeeded", "Failed", "Canceled", "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.JobProvisioningState - :ivar status_messages: Status messages of the job. - :vartype status_messages: list[~azure.mgmt.machinelearningservices.models.StatusMessage] - """ - - _validation = { - "job_type": {"required": True}, - "status": {"readonly": True}, - "created_date_time": {"readonly": True}, - "progress_metrics": {"readonly": True}, - "project_id": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "status_messages": {"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"}, - "created_date_time": {"key": "createdDateTime", "type": "iso-8601"}, - "data_configuration": {"key": "dataConfiguration", "type": "LabelingDataConfiguration"}, - "job_instructions": {"key": "jobInstructions", "type": "LabelingJobInstructions"}, - "label_categories": {"key": "labelCategories", "type": "{LabelCategory}"}, - "labeling_job_media_properties": {"key": "labelingJobMediaProperties", "type": "LabelingJobMediaProperties"}, - "ml_assist_configuration": {"key": "mlAssistConfiguration", "type": "MLAssistConfiguration"}, - "progress_metrics": {"key": "progressMetrics", "type": "ProgressMetrics"}, - "project_id": {"key": "projectId", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "status_messages": {"key": "statusMessages", "type": "[StatusMessage]"}, - } - - 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 data_configuration: Configuration of data used in the job. - :paramtype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :keyword job_instructions: Labeling instructions of the job. - :paramtype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :keyword label_categories: Label categories of the job. - :paramtype label_categories: dict[str, - ~azure.mgmt.machinelearningservices.models.LabelCategory] - :keyword labeling_job_media_properties: Media type specific properties in the job. - :paramtype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :keyword ml_assist_configuration: Configuration of MLAssist feature in the job. - :paramtype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - """ - super(LabelingJobProperties, self).__init__(**kwargs) - self.job_type = "Labeling" # type: str - self.created_date_time = None - self.data_configuration = kwargs.get("data_configuration", None) - self.job_instructions = kwargs.get("job_instructions", None) - self.label_categories = kwargs.get("label_categories", None) - self.labeling_job_media_properties = kwargs.get("labeling_job_media_properties", None) - self.ml_assist_configuration = kwargs.get("ml_assist_configuration", None) - self.progress_metrics = None - self.project_id = None - self.provisioning_state = None - self.status_messages = None - - -class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of LabelingJob entities. - - :ivar next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type LabelingJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - - _attribute_map = { - "next_link": {"key": "nextLink", "type": "str"}, - "value": {"key": "value", "type": "[LabelingJob]"}, - } - - def __init__(self, **kwargs): - """ - :keyword next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type LabelingJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - super(LabelingJobResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get("next_link", None) - self.value = kwargs.get("value", None) - - -class LabelingJobTextProperties(LabelingJobMediaProperties): - """Properties of a labeling job for text data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - - _validation = { - "media_type": {"required": True}, - } - - _attribute_map = { - "media_type": {"key": "mediaType", "type": "str"}, - "annotation_type": {"key": "annotationType", "type": "str"}, - } - - def __init__(self, **kwargs): - """ - :keyword annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - super(LabelingJobTextProperties, self).__init__(**kwargs) - self.media_type = "Text" # type: str - self.annotation_type = kwargs.get("annotation_type", 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 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, "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 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - - _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"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionManagedIdentity"}, - } - - def __init__(self, **kwargs): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 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 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 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 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"}, - "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 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 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 MLAssistConfiguration(msrest.serialization.Model): - """Labeling MLAssist configuration definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLAssistConfigurationDisabled, MLAssistConfigurationEnabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - "ml_assist": {"required": True}, - } - - _attribute_map = { - "ml_assist": {"key": "mlAssist", "type": "str"}, - } - - _subtype_map = { - "ml_assist": {"Disabled": "MLAssistConfigurationDisabled", "Enabled": "MLAssistConfigurationEnabled"} - } - - def __init__(self, **kwargs): - """ """ - super(MLAssistConfiguration, self).__init__(**kwargs) - self.ml_assist = None # type: Optional[str] - - -class MLAssistConfigurationDisabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is disabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - "ml_assist": {"required": True}, - } - - _attribute_map = { - "ml_assist": {"key": "mlAssist", "type": "str"}, - } - - def __init__(self, **kwargs): - """ """ - super(MLAssistConfigurationDisabled, self).__init__(**kwargs) - self.ml_assist = "Disabled" # type: str - - -class MLAssistConfigurationEnabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is enabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - :ivar inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :vartype inferencing_compute_binding: str - :ivar training_compute_binding: Required. [Required] AML compute binding used in training. - :vartype training_compute_binding: str - """ - - _validation = { - "ml_assist": {"required": True}, - "inferencing_compute_binding": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, - "training_compute_binding": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, - } - - _attribute_map = { - "ml_assist": {"key": "mlAssist", "type": "str"}, - "inferencing_compute_binding": {"key": "inferencingComputeBinding", "type": "str"}, - "training_compute_binding": {"key": "trainingComputeBinding", "type": "str"}, - } - - def __init__(self, **kwargs): - """ - :keyword inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :paramtype inferencing_compute_binding: str - :keyword training_compute_binding: Required. [Required] AML compute binding used in training. - :paramtype training_compute_binding: str - """ - super(MLAssistConfigurationEnabled, self).__init__(**kwargs) - self.ml_assist = "Enabled" # type: str - self.inferencing_compute_binding = kwargs["inferencing_compute_binding"] - self.training_compute_binding = kwargs["training_compute_binding"] - - -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, "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 asset_version: Output Asset Version. - :vartype asset_version: 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"}, - "asset_version": {"key": "assetVersion", "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 asset_version: Output Asset Version. - :paramtype asset_version: 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.asset_version = kwargs.get("asset_version", 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, "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, "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 asset_version: Output Asset Version. - :vartype asset_version: 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"}, - "asset_version": {"key": "assetVersion", "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 asset_version: Output Asset Version. - :paramtype asset_version: 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.asset_version = kwargs.get("asset_version", 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 ModelConfiguration(msrest.serialization.Model): - """Model configuration options. - - :ivar mode: Input delivery mode for the model. Possible values include: "ReadOnlyMount", - "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mounting path of the model in the target image. - :vartype mount_path: str - """ - - _attribute_map = { - "mode": {"key": "mode", "type": "str"}, - "mount_path": {"key": "mountPath", "type": "str"}, - } - - def __init__(self, **kwargs): - """ - :keyword mode: Input delivery mode for the model. Possible values include: "ReadOnlyMount", - "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mounting path of the model in the target image. - :paramtype mount_path: str - """ - super(ModelConfiguration, self).__init__(**kwargs) - self.mode = kwargs.get("mode", None) - self.mount_path = kwargs.get("mount_path", None) - - -class ModelContainer(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.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 ModelPackageInput(msrest.serialization.Model): - """Model package input options. - - All required parameters must be populated in order to send to Azure. - - :ivar input_type: Required. [Required] Type of the input included in the target image. Possible - values include: "UriFile", "UriFolder". - :vartype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :ivar mode: Input delivery mode of the input. Possible values include: "ReadOnlyMount", - "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mount path of the input in the target image. - :vartype mount_path: str - :ivar path: Required. [Required] Location of the input. - :vartype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - - _validation = { - "input_type": {"required": True}, - "path": {"required": True}, - } - - _attribute_map = { - "input_type": {"key": "inputType", "type": "str"}, - "mode": {"key": "mode", "type": "str"}, - "mount_path": {"key": "mountPath", "type": "str"}, - "path": {"key": "path", "type": "PackageInputPathBase"}, - } - - def __init__(self, **kwargs): - """ - :keyword input_type: Required. [Required] Type of the input included in the target image. - Possible values include: "UriFile", "UriFolder". - :paramtype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :keyword mode: Input delivery mode of the input. Possible values include: "ReadOnlyMount", - "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mount path of the input in the target image. - :paramtype mount_path: str - :keyword path: Required. [Required] Location of the input. - :paramtype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - super(ModelPackageInput, self).__init__(**kwargs) - self.input_type = kwargs["input_type"] - self.mode = kwargs.get("mode", None) - self.mount_path = kwargs.get("mount_path", None) - self.path = kwargs["path"] - - -class ModelVersion(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.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 - """ - - _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"}, - } - - 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 - """ - 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 - - -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 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 NlpFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML NLP training. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: int - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: int - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: int - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: int - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: float - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: float - """ - - _attribute_map = { - "gradient_accumulation_steps": {"key": "gradientAccumulationSteps", "type": "int"}, - "learning_rate": {"key": "learningRate", "type": "float"}, - "learning_rate_scheduler": {"key": "learningRateScheduler", "type": "str"}, - "model_name": {"key": "modelName", "type": "str"}, - "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, - "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, - "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, - "warmup_ratio": {"key": "warmupRatio", "type": "float"}, - "weight_decay": {"key": "weightDecay", "type": "float"}, - } - - def __init__(self, **kwargs): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: int - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: int - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: int - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: int - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: float - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: float - """ - super(NlpFixedParameters, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get("gradient_accumulation_steps", 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.number_of_epochs = kwargs.get("number_of_epochs", None) - self.training_batch_size = kwargs.get("training_batch_size", None) - self.validation_batch_size = kwargs.get("validation_batch_size", None) - self.warmup_ratio = kwargs.get("warmup_ratio", None) - self.weight_decay = kwargs.get("weight_decay", None) - - -class NlpParameterSubspace(msrest.serialization.Model): - """Stringified search spaces for each parameter. See below examples. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :vartype learning_rate_scheduler: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: str - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: str - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: str - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: str - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: str - """ - - _attribute_map = { - "gradient_accumulation_steps": {"key": "gradientAccumulationSteps", "type": "str"}, - "learning_rate": {"key": "learningRate", "type": "str"}, - "learning_rate_scheduler": {"key": "learningRateScheduler", "type": "str"}, - "model_name": {"key": "modelName", "type": "str"}, - "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, - "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, - "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, - "warmup_ratio": {"key": "warmupRatio", "type": "str"}, - "weight_decay": {"key": "weightDecay", "type": "str"}, - } - - def __init__(self, **kwargs): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :paramtype learning_rate_scheduler: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: str - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: str - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: str - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: str - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: str - """ - super(NlpParameterSubspace, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get("gradient_accumulation_steps", 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.number_of_epochs = kwargs.get("number_of_epochs", None) - self.training_batch_size = kwargs.get("training_batch_size", None) - self.validation_batch_size = kwargs.get("validation_batch_size", None) - self.warmup_ratio = kwargs.get("warmup_ratio", None) - self.weight_decay = kwargs.get("weight_decay", None) - - -class NlpSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter tuning related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. 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 for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(NlpSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get("early_termination", None) - self.sampling_algorithm = kwargs["sampling_algorithm"] - - -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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - "featurization_settings": {"key": "featurizationSettings", "type": "NlpVerticalFeaturizationSettings"}, - "fixed_parameters": {"key": "fixedParameters", "type": "NlpFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "NlpVerticalLimitSettings"}, - "search_space": {"key": "searchSpace", "type": "[NlpParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, - "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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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.fixed_parameters = kwargs.get("fixed_parameters", None) - self.limit_settings = kwargs.get("limit_settings", None) - self.search_space = kwargs.get("search_space", None) - self.sweep_settings = kwargs.get("sweep_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_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Timeout for individual HD trials. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, - "max_nodes": {"key": "maxNodes", "type": "int"}, - "max_trials": {"key": "maxTrials", "type": "int"}, - "timeout": {"key": "timeout", "type": "duration"}, - "trial_timeout": {"key": "trialTimeout", "type": "duration"}, - } - - def __init__(self, **kwargs): - """ - :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Timeout for individual HD trials. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get("max_concurrent_trials", 1) - self.max_nodes = kwargs.get("max_nodes", 1) - self.max_trials = kwargs.get("max_trials", 1) - self.timeout = kwargs.get("timeout", "P7D") - self.trial_timeout = kwargs.get("trial_timeout", 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 - """ - - _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"}, - } - - def __init__(self, **kwargs): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 - """ - 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", "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 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 NotificationSetting(msrest.serialization.Model): - """Configuration for notification. - - :ivar email_on: Send email notification to user on specified notfication 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 seperator. - :vartype emails: list[str] - """ - - _attribute_map = { - "email_on": {"key": "emailOn", "type": "[str]"}, - "emails": {"key": "emails", "type": "[str]"}, - } - - def __init__(self, **kwargs): - """ - :keyword email_on: Send email notification to user on specified notfication 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 seperator. - :paramtype emails: list[str] - """ - super(NotificationSetting, self).__init__(**kwargs) - self.email_on = kwargs.get("email_on", None) - self.emails = kwargs.get("emails", 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, "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 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 OnlineInferenceConfiguration(msrest.serialization.Model): - """Online inference configuration options. - - :ivar configurations: Additional configurations. - :vartype configurations: dict[str, str] - :ivar entry_script: Entry script or command to invoke. - :vartype entry_script: str - :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 = { - "configurations": {"key": "configurations", "type": "{str}"}, - "entry_script": {"key": "entryScript", "type": "str"}, - "liveness_route": {"key": "livenessRoute", "type": "Route"}, - "readiness_route": {"key": "readinessRoute", "type": "Route"}, - "scoring_route": {"key": "scoringRoute", "type": "Route"}, - } - - def __init__(self, **kwargs): - """ - :keyword configurations: Additional configurations. - :paramtype configurations: dict[str, str] - :keyword entry_script: Entry script or command to invoke. - :paramtype entry_script: str - :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(OnlineInferenceConfiguration, self).__init__(**kwargs) - self.configurations = kwargs.get("configurations", None) - self.entry_script = kwargs.get("entry_script", None) - 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 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 PackageInputPathBase(msrest.serialization.Model): - """PackageInputPathBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: PackageInputPathId, PackageInputPathVersion, PackageInputPathUrl. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - """ - - _validation = { - "input_path_type": {"required": True}, - } - - _attribute_map = { - "input_path_type": {"key": "inputPathType", "type": "str"}, - } - - _subtype_map = { - "input_path_type": { - "PathId": "PackageInputPathId", - "PathVersion": "PackageInputPathVersion", - "Url": "PackageInputPathUrl", - } - } - - def __init__(self, **kwargs): - """ """ - super(PackageInputPathBase, self).__init__(**kwargs) - self.input_path_type = None # type: Optional[str] - - -class PackageInputPathId(PackageInputPathBase): - """Package input path specified with a resource id. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_id: Input resource id. - :vartype resource_id: str - """ - - _validation = { - "input_path_type": {"required": True}, - } - - _attribute_map = { - "input_path_type": {"key": "inputPathType", "type": "str"}, - "resource_id": {"key": "resourceId", "type": "str"}, - } - - def __init__(self, **kwargs): - """ - :keyword resource_id: Input resource id. - :paramtype resource_id: str - """ - super(PackageInputPathId, self).__init__(**kwargs) - self.input_path_type = "PathId" # type: str - self.resource_id = kwargs.get("resource_id", None) - - -class PackageInputPathUrl(PackageInputPathBase): - """Package input path specified as an url. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar url: Input path url. - :vartype url: str - """ - - _validation = { - "input_path_type": {"required": True}, - } - - _attribute_map = { - "input_path_type": {"key": "inputPathType", "type": "str"}, - "url": {"key": "url", "type": "str"}, - } - - def __init__(self, **kwargs): - """ - :keyword url: Input path url. - :paramtype url: str - """ - super(PackageInputPathUrl, self).__init__(**kwargs) - self.input_path_type = "Url" # type: str - self.url = kwargs.get("url", None) - - -class PackageInputPathVersion(PackageInputPathBase): - """Package input path specified with name and version. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_name: Input resource name. - :vartype resource_name: str - :ivar resource_version: Input resource version. - :vartype resource_version: str - """ - - _validation = { - "input_path_type": {"required": True}, - } - - _attribute_map = { - "input_path_type": {"key": "inputPathType", "type": "str"}, - "resource_name": {"key": "resourceName", "type": "str"}, - "resource_version": {"key": "resourceVersion", "type": "str"}, - } - - def __init__(self, **kwargs): - """ - :keyword resource_name: Input resource name. - :paramtype resource_name: str - :keyword resource_version: Input resource version. - :paramtype resource_version: str - """ - super(PackageInputPathVersion, self).__init__(**kwargs) - self.input_path_type = "PathVersion" # type: str - self.resource_name = kwargs.get("resource_name", None) - self.resource_version = kwargs.get("resource_version", None) - - -class PackageRequest(msrest.serialization.Model): - """Model package operation request properties. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Required. [Required] Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_name: Required. [Required] Target environment name to be generated by - package. - :vartype target_environment_name: str - :ivar target_environment_version: Target environment version to be generated by package. - :vartype target_environment_version: str - """ - - _validation = { - "inferencing_server": {"required": True}, - "target_environment_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, - } - - _attribute_map = { - "base_environment_source": {"key": "baseEnvironmentSource", "type": "BaseEnvironmentSource"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, - "inferencing_server": {"key": "inferencingServer", "type": "InferencingServer"}, - "inputs": {"key": "inputs", "type": "[ModelPackageInput]"}, - "model_configuration": {"key": "modelConfiguration", "type": "ModelConfiguration"}, - "tags": {"key": "tags", "type": "{str}"}, - "target_environment_name": {"key": "targetEnvironmentName", "type": "str"}, - "target_environment_version": {"key": "targetEnvironmentVersion", "type": "str"}, - } - - def __init__(self, **kwargs): - """ - :keyword base_environment_source: Base environment to start with. - :paramtype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :keyword environment_variables: Collection of environment variables. - :paramtype environment_variables: dict[str, str] - :keyword inferencing_server: Required. [Required] Inferencing server configurations. - :paramtype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :keyword inputs: Collection of inputs. - :paramtype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :keyword model_configuration: Model configuration including the mount mode. - :paramtype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword target_environment_name: Required. [Required] Target environment name to be generated - by package. - :paramtype target_environment_name: str - :keyword target_environment_version: Target environment version to be generated by package. - :paramtype target_environment_version: str - """ - super(PackageRequest, self).__init__(**kwargs) - self.base_environment_source = kwargs.get("base_environment_source", None) - self.environment_variables = kwargs.get("environment_variables", None) - self.inferencing_server = kwargs["inferencing_server"] - self.inputs = kwargs.get("inputs", None) - self.model_configuration = kwargs.get("model_configuration", None) - self.tags = kwargs.get("tags", None) - self.target_environment_name = kwargs["target_environment_name"] - self.target_environment_version = kwargs.get("target_environment_version", None) - - -class PackageResponse(PackageRequest): - """Package response returned after async package operation completes successfully. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Required. [Required] Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_name: Required. [Required] Target environment name to be generated by - package. - :vartype target_environment_name: str - :ivar target_environment_version: Target environment version to be generated by package. - :vartype target_environment_version: str - :ivar build_id: Build id of the image build operation. - :vartype build_id: str - :ivar build_state: Build state of the image build operation. Possible values include: - "NotStarted", "Running", "Succeeded", "Failed". - :vartype build_state: str or ~azure.mgmt.machinelearningservices.models.PackageBuildState - :ivar log_url: Log url of the image build operation. - :vartype log_url: str - :ivar target_environment_id: Asset ID of the target environment created by package operation. - :vartype target_environment_id: str - """ - - _validation = { - "inferencing_server": {"required": True}, - "target_environment_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, - "build_id": {"readonly": True}, - "build_state": {"readonly": True}, - "log_url": {"readonly": True}, - "target_environment_id": {"readonly": True}, - } - - _attribute_map = { - "base_environment_source": {"key": "baseEnvironmentSource", "type": "BaseEnvironmentSource"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, - "inferencing_server": {"key": "inferencingServer", "type": "InferencingServer"}, - "inputs": {"key": "inputs", "type": "[ModelPackageInput]"}, - "model_configuration": {"key": "modelConfiguration", "type": "ModelConfiguration"}, - "tags": {"key": "tags", "type": "{str}"}, - "target_environment_name": {"key": "targetEnvironmentName", "type": "str"}, - "target_environment_version": {"key": "targetEnvironmentVersion", "type": "str"}, - "build_id": {"key": "buildId", "type": "str"}, - "build_state": {"key": "buildState", "type": "str"}, - "log_url": {"key": "logUrl", "type": "str"}, - "target_environment_id": {"key": "targetEnvironmentId", "type": "str"}, - } - - def __init__(self, **kwargs): - """ - :keyword base_environment_source: Base environment to start with. - :paramtype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :keyword environment_variables: Collection of environment variables. - :paramtype environment_variables: dict[str, str] - :keyword inferencing_server: Required. [Required] Inferencing server configurations. - :paramtype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :keyword inputs: Collection of inputs. - :paramtype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :keyword model_configuration: Model configuration including the mount mode. - :paramtype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword target_environment_name: Required. [Required] Target environment name to be generated - by package. - :paramtype target_environment_name: str - :keyword target_environment_version: Target environment version to be generated by package. - :paramtype target_environment_version: str - """ - super(PackageResponse, self).__init__(**kwargs) - self.build_id = None - self.build_state = None - self.log_url = None - self.target_environment_id = 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 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.PartialManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Additional attributes of the entity. - :vartype properties: any - :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"}, - "properties": {"key": "properties", "type": "object"}, - "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 properties: Additional attributes of the entity. - :paramtype properties: any - :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.kind = kwargs.get("kind", None) - self.properties = kwargs.get("properties", 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. - - 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - - _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"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionPersonalAccessToken"}, - } - - def __init__(self, **kwargs): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 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 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", "Labeling", "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", "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 - :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 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 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 - :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"}, - "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"}, - "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.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 - :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.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 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 - :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"}, - "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"}, - "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.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 - :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.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 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 ProgressMetrics(msrest.serialization.Model): - """Progress metrics definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar completed_datapoint_count: The completed datapoint count. - :vartype completed_datapoint_count: long - :ivar incremental_data_last_refresh_date_time: The time of last successful incremental data - refresh in UTC. - :vartype incremental_data_last_refresh_date_time: ~datetime.datetime - :ivar skipped_datapoint_count: The skipped datapoint count. - :vartype skipped_datapoint_count: long - :ivar total_datapoint_count: The total datapoint count. - :vartype total_datapoint_count: long - """ - - _validation = { - "completed_datapoint_count": {"readonly": True}, - "incremental_data_last_refresh_date_time": {"readonly": True}, - "skipped_datapoint_count": {"readonly": True}, - "total_datapoint_count": {"readonly": True}, - } - - _attribute_map = { - "completed_datapoint_count": {"key": "completedDatapointCount", "type": "long"}, - "incremental_data_last_refresh_date_time": {"key": "incrementalDataLastRefreshDateTime", "type": "iso-8601"}, - "skipped_datapoint_count": {"key": "skippedDatapointCount", "type": "long"}, - "total_datapoint_count": {"key": "totalDatapointCount", "type": "long"}, - } - - def __init__(self, **kwargs): - """ """ - super(ProgressMetrics, self).__init__(**kwargs) - self.completed_datapoint_count = None - self.incremental_data_last_refresh_date_time = None - self.skipped_datapoint_count = None - self.total_datapoint_count = 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: Enum to determine the job tier. Possible values include: "Spot", "Basic", - "Standard", "Premium". - :vartype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - :ivar priority: Controls the priority of the job on a compute. - :vartype priority: int - """ - - _attribute_map = { - "job_tier": {"key": "jobTier", "type": "str"}, - "priority": {"key": "priority", "type": "int"}, - } - - def __init__(self, **kwargs): - """ - :keyword job_tier: Enum to determine the job tier. Possible values include: "Spot", "Basic", - "Standard", "Premium". - :paramtype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - :keyword priority: Controls the priority of the job on a compute. - :paramtype priority: int - """ - super(QueueSettings, self).__init__(**kwargs) - self.job_tier = kwargs.get("job_tier", None) - self.priority = kwargs.get("priority", 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 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 logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :vartype logbase: str - :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"}, - "logbase": {"key": "logbase", "type": "str"}, - "rule": {"key": "rule", "type": "str"}, - "seed": {"key": "seed", "type": "int"}, - } - - def __init__(self, **kwargs): - """ - :keyword logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :paramtype logbase: str - :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.logbase = kwargs.get("logbase", None) - self.rule = kwargs.get("rule", None) - self.seed = kwargs.get("seed", 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 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 properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RegistryProperties - :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": "RegistryProperties"}, - "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.RegistryProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(Registry, 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 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 RegistryProperties(ResourceBase): - """Details of the Registry. - - :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 public_network_access: - :vartype public_network_access: str - :ivar discovery_url: - :vartype discovery_url: str - :ivar intellectual_property_publisher: - :vartype intellectual_property_publisher: str - :ivar managed_resource_group: Managed resource group created for the registry. - :vartype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar ml_flow_registry_uri: - :vartype ml_flow_registry_uri: str - :ivar private_link_count: - :vartype private_link_count: int - :ivar region_details: Details of each region the registry is in. - :vartype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - :ivar managed_resource_group_tags: Tags to be applied to the managed resource group associated - with this registry. - :vartype managed_resource_group_tags: dict[str, str] - """ - - _attribute_map = { - "description": {"key": "description", "type": "str"}, - "properties": {"key": "properties", "type": "{str}"}, - "tags": {"key": "tags", "type": "{str}"}, - "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, - "discovery_url": {"key": "discoveryUrl", "type": "str"}, - "intellectual_property_publisher": {"key": "intellectualPropertyPublisher", "type": "str"}, - "managed_resource_group": {"key": "managedResourceGroup", "type": "ArmResourceId"}, - "ml_flow_registry_uri": {"key": "mlFlowRegistryUri", "type": "str"}, - "private_link_count": {"key": "privateLinkCount", "type": "int"}, - "region_details": {"key": "regionDetails", "type": "[RegistryRegionArmDetails]"}, - "managed_resource_group_tags": {"key": "managedResourceGroupTags", "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 public_network_access: - :paramtype public_network_access: str - :keyword discovery_url: - :paramtype discovery_url: str - :keyword intellectual_property_publisher: - :paramtype intellectual_property_publisher: str - :keyword managed_resource_group: Managed resource group created for the registry. - :paramtype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword ml_flow_registry_uri: - :paramtype ml_flow_registry_uri: str - :keyword private_link_count: - :paramtype private_link_count: int - :keyword region_details: Details of each region the registry is in. - :paramtype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - :keyword managed_resource_group_tags: Tags to be applied to the managed resource group - associated with this registry. - :paramtype managed_resource_group_tags: dict[str, str] - """ - super(RegistryProperties, self).__init__(**kwargs) - self.public_network_access = kwargs.get("public_network_access", 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.ml_flow_registry_uri = kwargs.get("ml_flow_registry_uri", None) - self.private_link_count = kwargs.get("private_link_count", None) - self.region_details = kwargs.get("region_details", None) - self.managed_resource_group_tags = kwargs.get("managed_resource_group_tags", 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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"}, - "fixed_parameters": {"key": "fixedParameters", "type": "TableFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "TableVerticalLimitSettings"}, - "n_cross_validations": {"key": "nCrossValidations", "type": "NCrossValidations"}, - "search_space": {"key": "searchSpace", "type": "[TableParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "TableSweepSettings"}, - "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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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.fixed_parameters = kwargs.get("fixed_parameters", None) - self.limit_settings = kwargs.get("limit_settings", None) - self.n_cross_validations = kwargs.get("n_cross_validations", None) - self.search_space = kwargs.get("search_space", None) - self.sweep_settings = kwargs.get("sweep_settings", 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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"}, - "training_mode": {"key": "trainingMode", "type": "str"}, - "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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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 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 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 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _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"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionSharedAccessSignature"}, - } - - def __init__(self, **kwargs): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 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 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 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(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.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 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 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - - _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"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionServicePrincipal"}, - } - - def __init__(self, **kwargs): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 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", "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 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 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): - """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 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", "Labeling", "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", "Scheduled". - :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 resource 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 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, "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"}, - "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 resource 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 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.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 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 StatusMessage(msrest.serialization.Model): - """Active message associated with project. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Service-defined message code. - :vartype code: str - :ivar created_date_time: Time in UTC at which the message was created. - :vartype created_date_time: ~datetime.datetime - :ivar level: Severity level of message. Possible values include: "Error", "Information", - "Warning". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.StatusMessageLevel - :ivar message: A human-readable representation of the message code. - :vartype message: str - """ - - _validation = { - "code": {"readonly": True}, - "created_date_time": {"readonly": True}, - "level": {"readonly": True}, - "message": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "created_date_time": {"key": "createdDateTime", "type": "iso-8601"}, - "level": {"key": "level", "type": "str"}, - "message": {"key": "message", "type": "str"}, - } - - def __init__(self, **kwargs): - """ """ - super(StatusMessage, self).__init__(**kwargs) - self.code = None - self.created_date_time = None - self.level = None - self.message = None - - -class StorageAccountDetails(msrest.serialization.Model): - """Details of storage account to be used for the Registry. - - :ivar system_created_storage_account: - :vartype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :ivar user_created_storage_account: - :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: - :paramtype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :keyword user_created_storage_account: - :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", "Labeling", "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", "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 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", "SoftDeleted". - :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_sku: - :vartype acr_account_sku: str - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - "acr_account_sku": {"key": "acrAccountSku", "type": "str"}, - "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, - } - - def __init__(self, **kwargs): - """ - :keyword acr_account_sku: - :paramtype acr_account_sku: str - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(SystemCreatedAcrAccount, self).__init__(**kwargs) - 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 arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar storage_account_hns_enabled: - :vartype storage_account_hns_enabled: bool - :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 - :ivar allow_blob_public_access: - :vartype allow_blob_public_access: bool - """ - - _attribute_map = { - "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, - "storage_account_hns_enabled": {"key": "storageAccountHnsEnabled", "type": "bool"}, - "storage_account_type": {"key": "storageAccountType", "type": "str"}, - "allow_blob_public_access": {"key": "allowBlobPublicAccess", "type": "bool"}, - } - - def __init__(self, **kwargs): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword storage_account_hns_enabled: - :paramtype storage_account_hns_enabled: bool - :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 - :keyword allow_blob_public_access: - :paramtype allow_blob_public_access: bool - """ - super(SystemCreatedStorageAccount, self).__init__(**kwargs) - 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_type = kwargs.get("storage_account_type", None) - self.allow_blob_public_access = kwargs.get("allow_blob_public_access", 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 TableFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML Table training. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: int - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: int - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: int - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: int - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: float - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: int - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: int - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: float - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: float - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: float - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: float - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: bool - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: bool - """ - - _attribute_map = { - "booster": {"key": "booster", "type": "str"}, - "boosting_type": {"key": "boostingType", "type": "str"}, - "grow_policy": {"key": "growPolicy", "type": "str"}, - "learning_rate": {"key": "learningRate", "type": "float"}, - "max_bin": {"key": "maxBin", "type": "int"}, - "max_depth": {"key": "maxDepth", "type": "int"}, - "max_leaves": {"key": "maxLeaves", "type": "int"}, - "min_data_in_leaf": {"key": "minDataInLeaf", "type": "int"}, - "min_split_gain": {"key": "minSplitGain", "type": "float"}, - "model_name": {"key": "modelName", "type": "str"}, - "n_estimators": {"key": "nEstimators", "type": "int"}, - "num_leaves": {"key": "numLeaves", "type": "int"}, - "preprocessor_name": {"key": "preprocessorName", "type": "str"}, - "reg_alpha": {"key": "regAlpha", "type": "float"}, - "reg_lambda": {"key": "regLambda", "type": "float"}, - "subsample": {"key": "subsample", "type": "float"}, - "subsample_freq": {"key": "subsampleFreq", "type": "float"}, - "tree_method": {"key": "treeMethod", "type": "str"}, - "with_mean": {"key": "withMean", "type": "bool"}, - "with_std": {"key": "withStd", "type": "bool"}, - } - - def __init__(self, **kwargs): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: int - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: int - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: int - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: int - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: float - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: int - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: int - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: float - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: float - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: float - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: float - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: bool - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: bool - """ - super(TableFixedParameters, self).__init__(**kwargs) - self.booster = kwargs.get("booster", None) - self.boosting_type = kwargs.get("boosting_type", None) - self.grow_policy = kwargs.get("grow_policy", None) - self.learning_rate = kwargs.get("learning_rate", None) - self.max_bin = kwargs.get("max_bin", None) - self.max_depth = kwargs.get("max_depth", None) - self.max_leaves = kwargs.get("max_leaves", None) - self.min_data_in_leaf = kwargs.get("min_data_in_leaf", None) - self.min_split_gain = kwargs.get("min_split_gain", None) - self.model_name = kwargs.get("model_name", None) - self.n_estimators = kwargs.get("n_estimators", None) - self.num_leaves = kwargs.get("num_leaves", None) - self.preprocessor_name = kwargs.get("preprocessor_name", None) - self.reg_alpha = kwargs.get("reg_alpha", None) - self.reg_lambda = kwargs.get("reg_lambda", None) - self.subsample = kwargs.get("subsample", None) - self.subsample_freq = kwargs.get("subsample_freq", None) - self.tree_method = kwargs.get("tree_method", None) - self.with_mean = kwargs.get("with_mean", False) - self.with_std = kwargs.get("with_std", False) - - -class TableParameterSubspace(msrest.serialization.Model): - """TableParameterSubspace. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: str - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: str - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: str - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: str - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: str - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: str - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: str - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: str - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: str - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: str - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: str - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: str - """ - - _attribute_map = { - "booster": {"key": "booster", "type": "str"}, - "boosting_type": {"key": "boostingType", "type": "str"}, - "grow_policy": {"key": "growPolicy", "type": "str"}, - "learning_rate": {"key": "learningRate", "type": "str"}, - "max_bin": {"key": "maxBin", "type": "str"}, - "max_depth": {"key": "maxDepth", "type": "str"}, - "max_leaves": {"key": "maxLeaves", "type": "str"}, - "min_data_in_leaf": {"key": "minDataInLeaf", "type": "str"}, - "min_split_gain": {"key": "minSplitGain", "type": "str"}, - "model_name": {"key": "modelName", "type": "str"}, - "n_estimators": {"key": "nEstimators", "type": "str"}, - "num_leaves": {"key": "numLeaves", "type": "str"}, - "preprocessor_name": {"key": "preprocessorName", "type": "str"}, - "reg_alpha": {"key": "regAlpha", "type": "str"}, - "reg_lambda": {"key": "regLambda", "type": "str"}, - "subsample": {"key": "subsample", "type": "str"}, - "subsample_freq": {"key": "subsampleFreq", "type": "str"}, - "tree_method": {"key": "treeMethod", "type": "str"}, - "with_mean": {"key": "withMean", "type": "str"}, - "with_std": {"key": "withStd", "type": "str"}, - } - - def __init__(self, **kwargs): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: str - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: str - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: str - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: str - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: str - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: str - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: str - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: str - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: str - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: str - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: str - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: str - """ - super(TableParameterSubspace, self).__init__(**kwargs) - self.booster = kwargs.get("booster", None) - self.boosting_type = kwargs.get("boosting_type", None) - self.grow_policy = kwargs.get("grow_policy", None) - self.learning_rate = kwargs.get("learning_rate", None) - self.max_bin = kwargs.get("max_bin", None) - self.max_depth = kwargs.get("max_depth", None) - self.max_leaves = kwargs.get("max_leaves", None) - self.min_data_in_leaf = kwargs.get("min_data_in_leaf", None) - self.min_split_gain = kwargs.get("min_split_gain", None) - self.model_name = kwargs.get("model_name", None) - self.n_estimators = kwargs.get("n_estimators", None) - self.num_leaves = kwargs.get("num_leaves", None) - self.preprocessor_name = kwargs.get("preprocessor_name", None) - self.reg_alpha = kwargs.get("reg_alpha", None) - self.reg_lambda = kwargs.get("reg_lambda", None) - self.subsample = kwargs.get("subsample", None) - self.subsample_freq = kwargs.get("subsample_freq", None) - self.tree_method = kwargs.get("tree_method", None) - self.with_mean = kwargs.get("with_mean", None) - self.with_std = kwargs.get("with_std", None) - - -class TableSweepSettings(msrest.serialization.Model): - """TableSweepSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. 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 for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(TableSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get("early_termination", None) - self.sampling_algorithm = kwargs["sampling_algorithm"] - - -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_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of iterations. - :vartype max_trials: int - :ivar sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to trigger. - :vartype sweep_concurrent_trials: int - :ivar sweep_trials: Number of sweeping runs that user wants to trigger. - :vartype sweep_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_nodes": {"key": "maxNodes", "type": "int"}, - "max_trials": {"key": "maxTrials", "type": "int"}, - "sweep_concurrent_trials": {"key": "sweepConcurrentTrials", "type": "int"}, - "sweep_trials": {"key": "sweepTrials", "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_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of iterations. - :paramtype max_trials: int - :keyword sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to - trigger. - :paramtype sweep_concurrent_trials: int - :keyword sweep_trials: Number of sweeping runs that user wants to trigger. - :paramtype sweep_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_nodes = kwargs.get("max_nodes", 1) - self.max_trials = kwargs.get("max_trials", 1000) - self.sweep_concurrent_trials = kwargs.get("sweep_concurrent_trials", 0) - self.sweep_trials = kwargs.get("sweep_trials", 0) - 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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"}, - "fixed_parameters": {"key": "fixedParameters", "type": "NlpFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "NlpVerticalLimitSettings"}, - "search_space": {"key": "searchSpace", "type": "[NlpParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, - "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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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.fixed_parameters = kwargs.get("fixed_parameters", None) - self.limit_settings = kwargs.get("limit_settings", None) - self.search_space = kwargs.get("search_space", None) - self.sweep_settings = kwargs.get("sweep_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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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"}, - "fixed_parameters": {"key": "fixedParameters", "type": "NlpFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "NlpVerticalLimitSettings"}, - "search_space": {"key": "searchSpace", "type": "[NlpParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, - "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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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.fixed_parameters = kwargs.get("fixed_parameters", None) - self.limit_settings = kwargs.get("limit_settings", None) - self.search_space = kwargs.get("search_space", None) - self.sweep_settings = kwargs.get("sweep_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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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"}, - "fixed_parameters": {"key": "fixedParameters", "type": "NlpFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "NlpVerticalLimitSettings"}, - "search_space": {"key": "searchSpace", "type": "[NlpParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, - "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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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.fixed_parameters = kwargs.get("fixed_parameters", None) - self.limit_settings = kwargs.get("limit_settings", None) - self.search_space = kwargs.get("search_space", None) - self.sweep_settings = kwargs.get("sweep_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 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, "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 TritonInferencingServer(InferencingServer): - """Triton inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for Triton. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - "server_type": {"required": True}, - } - - _attribute_map = { - "server_type": {"key": "serverType", "type": "str"}, - "inference_configuration": {"key": "inferenceConfiguration", "type": "OnlineInferenceConfiguration"}, - } - - def __init__(self, **kwargs): - """ - :keyword inference_configuration: Inference configuration for Triton. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(TritonInferencingServer, self).__init__(**kwargs) - self.server_type = "Triton" # type: str - self.inference_configuration = kwargs.get("inference_configuration", 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, "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 asset_version: Output Asset Version. - :vartype asset_version: 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"}, - "asset_version": {"key": "assetVersion", "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 asset_version: Output Asset Version. - :paramtype asset_version: 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.asset_version = kwargs.get("asset_version", 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, "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, "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 asset_version: Output Asset Version. - :vartype asset_version: 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"}, - "asset_version": {"key": "assetVersion", "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 asset_version: Output Asset Version. - :paramtype asset_version: 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.asset_version = kwargs.get("asset_version", 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, "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, "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 asset_version: Output Asset Version. - :vartype asset_version: 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"}, - "asset_version": {"key": "assetVersion", "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 asset_version: Output Asset Version. - :paramtype asset_version: 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.asset_version = kwargs.get("asset_version", 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 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. - - 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - - _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"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionUsernamePassword"}, - } - - def __init__(self, **kwargs): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 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", "SoftDeleted". - :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: 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 - :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. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. - :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", - "SoftDeleted". - :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 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 - :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 soft_deleted_at: The timestamp when the workspace was soft deleted. - :vartype soft_deleted_at: str - :ivar scheduled_purge_date: The timestamp when the soft deleted workspace is going to be - purged. - :vartype scheduled_purge_date: str - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :vartype system_datastores_auth_mode: 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}, - "soft_deleted_at": {"readonly": True}, - "scheduled_purge_date": {"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"}, - "tags": {"key": "tags", "type": "{str}"}, - "sku": {"key": "sku", "type": "Sku"}, - "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"}, - "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"}, - "v1_legacy_mode": {"key": "properties.v1LegacyMode", "type": "bool"}, - "soft_deleted_at": {"key": "properties.softDeletedAt", "type": "str"}, - "scheduled_purge_date": {"key": "properties.scheduledPurgeDate", "type": "str"}, - "system_datastores_auth_mode": {"key": "properties.systemDatastoresAuthMode", "type": "str"}, - } - - def __init__(self, **kwargs): - """ - :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 - :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. - :paramtype application_insights: str - :keyword container_registry: ARM id of the container registry associated with this workspace. - :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 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 - :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 system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :paramtype system_datastores_auth_mode: 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.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.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 - self.v1_legacy_mode = kwargs.get("v1_legacy_mode", False) - self.soft_deleted_at = None - self.scheduled_purge_date = None - self.system_datastores_auth_mode = kwargs.get("system_datastores_auth_mode", 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 WorkspaceConnectionManagedIdentity(msrest.serialization.Model): - """WorkspaceConnectionManagedIdentity. - - :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(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get("resource_id", None) - self.client_id = kwargs.get("client_id", 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. - - 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 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 WorkspaceConnectionUsernamePassword(msrest.serialization.Model): - """WorkspaceConnectionUsernamePassword. - - :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(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.username = kwargs.get("username", None) - self.password = kwargs.get("password", 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.ManagedServiceIdentity - :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 - :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 encryption: The encryption settings of the workspace. - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "sku": {"key": "sku", "type": "Sku"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "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"}, - "application_insights": {"key": "properties.applicationInsights", "type": "str"}, - "container_registry": {"key": "properties.containerRegistry", "type": "str"}, - "encryption": {"key": "properties.encryption", "type": "EncryptionUpdateProperties"}, - } - - 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.ManagedServiceIdentity - :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 - :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 encryption: The encryption settings of the workspace. - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - """ - 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) - self.application_insights = kwargs.get("application_insights", None) - self.container_registry = kwargs.get("container_registry", None) - self.encryption = kwargs.get("encryption", None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_models_py3.py deleted file mode 100644 index ec36e0e8877e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_models_py3.py +++ /dev/null @@ -1,27405 +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: AccessKeyAuthTypeWorkspaceConnectionProperties, 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 - """ - - _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"}, - } - - _subtype_map = { - "auth_type": { - "AccessKey": "AccessKeyAuthTypeWorkspaceConnectionProperties", - "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, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 - """ - 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 - - -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """AccessKeyAuthTypeWorkspaceConnectionProperties. - - 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - - _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"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionAccessKey"}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionAccessKey"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__( - category=category, target=target, value=value, value_format=value_format, **kwargs - ) - self.auth_type = "AccessKey" # 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, 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 AcrDetails(msrest.serialization.Model): - """Details of ACR account to be used for the Registry. - - :ivar system_created_acr_account: - :vartype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :ivar user_created_acr_account: - :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: - :paramtype system_created_acr_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedAcrAccount - :keyword user_created_acr_account: - :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", "SoftDeleted". - :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", "SoftDeleted". - :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 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", "Custom". - :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", "Custom". - :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", "SoftDeleted". - :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 AmlOperation(msrest.serialization.Model): - """Azure Machine Learning 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.AmlOperationDisplay - :ivar is_data_action: Indicates whether the operation applies to data-plane. - :vartype is_data_action: bool - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display": {"key": "display", "type": "AmlOperationDisplay"}, - "is_data_action": {"key": "isDataAction", "type": "bool"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - display: Optional["AmlOperationDisplay"] = None, - is_data_action: Optional[bool] = None, - **kwargs - ): - """ - :keyword name: Operation name: {provider}/{resource}/{operation}. - :paramtype name: str - :keyword display: Display name of operation. - :paramtype display: ~azure.mgmt.machinelearningservices.models.AmlOperationDisplay - :keyword is_data_action: Indicates whether the operation applies to data-plane. - :paramtype is_data_action: bool - """ - super(AmlOperation, self).__init__(**kwargs) - self.name = name - self.display = display - self.is_data_action = is_data_action - - -class AmlOperationDisplay(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(AmlOperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description - - -class AmlOperationListResult(msrest.serialization.Model): - """An array of operations supported by the resource provider. - - :ivar value: List of AML operations supported by the AML resource provider. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] - """ - - _attribute_map = { - "value": {"key": "value", "type": "[AmlOperation]"}, - } - - def __init__(self, *, value: Optional[List["AmlOperation"]] = None, **kwargs): - """ - :keyword value: List of AML operations supported by the AML resource provider. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] - """ - super(AmlOperationListResult, self).__init__(**kwargs) - self.value = value - - -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 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 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, "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 asset_version: Output Asset Version. - :vartype asset_version: 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"}, - "asset_version": {"key": "assetVersion", "type": "str"}, - "mode": {"key": "mode", "type": "str"}, - "uri": {"key": "uri", "type": "str"}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: 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 asset_version: Output Asset Version. - :paramtype asset_version: 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.asset_version = asset_version - 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 AutologgerSettings(msrest.serialization.Model): - """Settings for Autologger. - - All required parameters must be populated in order to send to Azure. - - :ivar mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is enabled. - Possible values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - - _validation = { - "mlflow_autologger": {"required": True}, - } - - _attribute_map = { - "mlflow_autologger": {"key": "mlflowAutologger", "type": "str"}, - } - - def __init__(self, *, mlflow_autologger: Union[str, "MLFlowAutologgerState"], **kwargs): - """ - :keyword mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is - enabled. Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - super(AutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = mlflow_autologger - - -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, LabelingJobProperties, 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", "Labeling", "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", "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}"}, - "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", - "Labeling": "LabelingJobProperties", - "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", "Labeling", "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", "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 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, 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(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", "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 = { - "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", "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 = { - "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", "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 = { - "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 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", "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 = { - "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 InferencingServer(msrest.serialization.Model): - """InferencingServer. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureMLBatchInferencingServer, AzureMLOnlineInferencingServer, CustomInferencingServer, TritonInferencingServer. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - """ - - _validation = { - "server_type": {"required": True}, - } - - _attribute_map = { - "server_type": {"key": "serverType", "type": "str"}, - } - - _subtype_map = { - "server_type": { - "AzureMLBatch": "AzureMLBatchInferencingServer", - "AzureMLOnline": "AzureMLOnlineInferencingServer", - "Custom": "CustomInferencingServer", - "Triton": "TritonInferencingServer", - } - } - - def __init__(self, **kwargs): - """ """ - super(InferencingServer, self).__init__(**kwargs) - self.server_type = None # type: Optional[str] - - -class AzureMLBatchInferencingServer(InferencingServer): - """Azure ML batch inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML batch inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - "server_type": {"required": True}, - } - - _attribute_map = { - "server_type": {"key": "serverType", "type": "str"}, - "code_configuration": {"key": "codeConfiguration", "type": "CodeConfiguration"}, - } - - def __init__(self, *, code_configuration: Optional["CodeConfiguration"] = None, **kwargs): - """ - :keyword code_configuration: Code configuration for AML batch inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLBatchInferencingServer, self).__init__(**kwargs) - self.server_type = "AzureMLBatch" # type: str - self.code_configuration = code_configuration - - -class AzureMLOnlineInferencingServer(InferencingServer): - """Azure ML online inferencing configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - "server_type": {"required": True}, - } - - _attribute_map = { - "server_type": {"key": "serverType", "type": "str"}, - "code_configuration": {"key": "codeConfiguration", "type": "CodeConfiguration"}, - } - - def __init__(self, *, code_configuration: Optional["CodeConfiguration"] = None, **kwargs): - """ - :keyword code_configuration: Code configuration for AML inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLOnlineInferencingServer, self).__init__(**kwargs) - self.server_type = "AzureMLOnline" # type: str - self.code_configuration = code_configuration - - -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 BaseEnvironmentSource(msrest.serialization.Model): - """BaseEnvironmentSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BaseEnvironmentId. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - """ - - _validation = { - "base_environment_source_type": {"required": True}, - } - - _attribute_map = { - "base_environment_source_type": {"key": "baseEnvironmentSourceType", "type": "str"}, - } - - _subtype_map = {"base_environment_source_type": {"EnvironmentAsset": "BaseEnvironmentId"}} - - def __init__(self, **kwargs): - """ """ - super(BaseEnvironmentSource, self).__init__(**kwargs) - self.base_environment_source_type = None # type: Optional[str] - - -class BaseEnvironmentId(BaseEnvironmentSource): - """Base environment type. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - :ivar resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :vartype resource_id: str - """ - - _validation = { - "base_environment_source_type": {"required": True}, - "resource_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, - } - - _attribute_map = { - "base_environment_source_type": {"key": "baseEnvironmentSourceType", "type": "str"}, - "resource_id": {"key": "resourceId", "type": "str"}, - } - - def __init__(self, *, resource_id: str, **kwargs): - """ - :keyword resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :paramtype resource_id: str - """ - super(BaseEnvironmentId, self).__init__(**kwargs) - self.base_environment_source_type = "EnvironmentAsset" # type: str - self.resource_id = resource_id - - -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 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 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 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_properties: Properties relevant to different deployment types. - :vartype deployment_properties: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentPropertiesAutoGenerated - :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_properties": {"key": "deploymentProperties", "type": "BatchDeploymentPropertiesAutoGenerated"}, - "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_properties: Optional["BatchDeploymentPropertiesAutoGenerated"] = 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 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_properties: Properties relevant to different deployment types. - :paramtype deployment_properties: - ~azure.mgmt.machinelearningservices.models.BatchDeploymentPropertiesAutoGenerated - :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_properties = deployment_properties - 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 BatchDeploymentPropertiesAutoGenerated(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: BatchPipelineComponentDeploymentProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_property_type: Required. [Required] The type of the deployment.Constant filled - by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_property_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentPropertyType - """ - - _validation = { - "deployment_property_type": {"required": True}, - } - - _attribute_map = { - "deployment_property_type": {"key": "deploymentPropertyType", "type": "str"}, - } - - _subtype_map = {"deployment_property_type": {"PipelineComponent": "BatchPipelineComponentDeploymentProperties"}} - - def __init__(self, **kwargs): - """ """ - super(BatchDeploymentPropertiesAutoGenerated, self).__init__(**kwargs) - self.deployment_property_type = None # type: Optional[str] - - -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 BatchPipelineComponentDeploymentProperties(BatchDeploymentPropertiesAutoGenerated): - """Properties for a Batch Pipeline Component Deployment. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_property_type: Required. [Required] The type of the deployment.Constant filled - by server. Possible values include: "Model", "PipelineComponent". - :vartype deployment_property_type: str or - ~azure.mgmt.machinelearningservices.models.BatchDeploymentPropertyType - :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_property_type": {"required": True}, - } - - _attribute_map = { - "deployment_property_type": {"key": "deploymentPropertyType", "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(BatchPipelineComponentDeploymentProperties, self).__init__(**kwargs) - self.deployment_property_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 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 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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"}, - "fixed_parameters": {"key": "fixedParameters", "type": "TableFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "TableVerticalLimitSettings"}, - "n_cross_validations": {"key": "nCrossValidations", "type": "NCrossValidations"}, - "search_space": {"key": "searchSpace", "type": "[TableParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "TableSweepSettings"}, - "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, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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"}, - "fixed_parameters": {"key": "fixedParameters", "type": "TableFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "TableVerticalLimitSettings"}, - "n_cross_validations": {"key": "nCrossValidations", "type": "NCrossValidations"}, - "search_space": {"key": "searchSpace", "type": "[TableParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "TableSweepSettings"}, - "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, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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, - fixed_parameters=fixed_parameters, - limit_settings=limit_settings, - n_cross_validations=n_cross_validations, - search_space=search_space, - sweep_settings=sweep_settings, - 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.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - 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 - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - - _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"}, - "training_mode": {"key": "trainingMode", "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, - training_mode: Optional[Union[str, "TrainingMode"]] = 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - 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 - self.training_mode = training_mode - - -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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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"}, - "training_mode": {"key": "trainingMode", "type": "str"}, - "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, - training_mode: Optional[Union[str, "TrainingMode"]] = 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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, - training_mode=training_mode, - **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 ExportSummary(msrest.serialization.Model): - """ExportSummary. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CsvExportSummary, CocoExportSummary, DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - """ - - _validation = { - "end_date_time": {"readonly": True}, - "exported_row_count": {"readonly": True}, - "format": {"required": True}, - "labeling_job_id": {"readonly": True}, - "start_date_time": {"readonly": True}, - } - - _attribute_map = { - "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, - "exported_row_count": {"key": "exportedRowCount", "type": "long"}, - "format": {"key": "format", "type": "str"}, - "labeling_job_id": {"key": "labelingJobId", "type": "str"}, - "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, - } - - _subtype_map = { - "format": {"CSV": "CsvExportSummary", "Coco": "CocoExportSummary", "Dataset": "DatasetExportSummary"} - } - - def __init__(self, **kwargs): - """ """ - super(ExportSummary, self).__init__(**kwargs) - self.end_date_time = None - self.exported_row_count = None - self.format = None # type: Optional[str] - self.labeling_job_id = None - self.start_date_time = None - - -class CocoExportSummary(ExportSummary): - """CocoExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - "end_date_time": {"readonly": True}, - "exported_row_count": {"readonly": True}, - "format": {"required": True}, - "labeling_job_id": {"readonly": True}, - "start_date_time": {"readonly": True}, - "container_name": {"readonly": True}, - "snapshot_path": {"readonly": True}, - } - - _attribute_map = { - "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, - "exported_row_count": {"key": "exportedRowCount", "type": "long"}, - "format": {"key": "format", "type": "str"}, - "labeling_job_id": {"key": "labelingJobId", "type": "str"}, - "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, - "container_name": {"key": "containerName", "type": "str"}, - "snapshot_path": {"key": "snapshotPath", "type": "str"}, - } - - def __init__(self, **kwargs): - """ """ - super(CocoExportSummary, self).__init__(**kwargs) - self.format = "Coco" # type: str - self.container_name = None - self.snapshot_path = 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, *, 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(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.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(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.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 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", "Labeling", "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", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar autologger_settings: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :vartype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :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, "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"}, - "autologger_settings": {"key": "autologgerSettings", "type": "AutologgerSettings"}, - "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, - autologger_settings: Optional["AutologgerSettings"] = 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 autologger_settings: Distribution configuration of the job. If set, this should be one - of Mpi, Tensorflow, PyTorch, or null. - :paramtype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :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.autologger_settings = autologger_settings - 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(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.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(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.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", "SoftDeleted". - :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 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"}, - "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, - 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 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.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", "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 - :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", "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 - :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", "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 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"}, - "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", - 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 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.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 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 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.TriggerType - :ivar recurrence: Required if triggerType is Recurrence. - :vartype recurrence: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :ivar cron: Required if triggerType is Cron. - :vartype cron: ~azure.mgmt.machinelearningservices.models.CronTrigger - :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": "RecurrenceTrigger"}, - "cron": {"key": "cron", "type": "CronTrigger"}, - "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, "TriggerType"]] = None, - recurrence: Optional["RecurrenceTrigger"] = None, - cron: Optional["CronTrigger"] = 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.TriggerType - :keyword recurrence: Required if triggerType is Recurrence. - :paramtype recurrence: ~azure.mgmt.machinelearningservices.models.RecurrenceTrigger - :keyword cron: Required if triggerType is Cron. - :paramtype cron: ~azure.mgmt.machinelearningservices.models.CronTrigger - :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 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 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, "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 CsvExportSummary(ExportSummary): - """CsvExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - "end_date_time": {"readonly": True}, - "exported_row_count": {"readonly": True}, - "format": {"required": True}, - "labeling_job_id": {"readonly": True}, - "start_date_time": {"readonly": True}, - "container_name": {"readonly": True}, - "snapshot_path": {"readonly": True}, - } - - _attribute_map = { - "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, - "exported_row_count": {"key": "exportedRowCount", "type": "long"}, - "format": {"key": "format", "type": "str"}, - "labeling_job_id": {"key": "labelingJobId", "type": "str"}, - "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, - "container_name": {"key": "containerName", "type": "str"}, - "snapshot_path": {"key": "snapshotPath", "type": "str"}, - } - - def __init__(self, **kwargs): - """ """ - super(CsvExportSummary, self).__init__(**kwargs) - self.format = "CSV" # type: str - self.container_name = None - self.snapshot_path = None - - -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 CustomInferencingServer(InferencingServer): - """Custom inference server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for custom inferencing. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - "server_type": {"required": True}, - } - - _attribute_map = { - "server_type": {"key": "serverType", "type": "str"}, - "inference_configuration": {"key": "inferenceConfiguration", "type": "OnlineInferenceConfiguration"}, - } - - def __init__(self, *, inference_configuration: Optional["OnlineInferenceConfiguration"] = None, **kwargs): - """ - :keyword inference_configuration: Inference configuration for custom inferencing. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(CustomInferencingServer, self).__init__(**kwargs) - self.server_type = "Custom" # type: str - self.inference_configuration = inference_configuration - - -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, "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 asset_version: Output Asset Version. - :vartype asset_version: 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"}, - "asset_version": {"key": "assetVersion", "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, - asset_version: 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 asset_version: Output Asset Version. - :paramtype asset_version: 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, asset_version=asset_version, mode=mode, uri=uri, **kwargs - ) - self.asset_name = asset_name - self.asset_version = asset_version - self.mode = mode - self.uri = uri - self.job_output_type = "custom_model" # type: str - self.description = description - - -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] - """ - - _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]"}, - } - - 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, - **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] - """ - 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 - - -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", "SoftDeleted". - :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 DataContainer(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.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 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", "SoftDeleted". - :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", "SoftDeleted". - :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 DatasetExportSummary(ExportSummary): - """DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar labeled_asset_name: The unique name of the labeled data asset. - :vartype labeled_asset_name: str - """ - - _validation = { - "end_date_time": {"readonly": True}, - "exported_row_count": {"readonly": True}, - "format": {"required": True}, - "labeling_job_id": {"readonly": True}, - "start_date_time": {"readonly": True}, - "labeled_asset_name": {"readonly": True}, - } - - _attribute_map = { - "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, - "exported_row_count": {"key": "exportedRowCount", "type": "long"}, - "format": {"key": "format", "type": "str"}, - "labeling_job_id": {"key": "labelingJobId", "type": "str"}, - "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, - "labeled_asset_name": {"key": "labeledAssetName", "type": "str"}, - } - - def __init__(self, **kwargs): - """ """ - super(DatasetExportSummary, self).__init__(**kwargs) - self.format = "Dataset" # type: str - self.labeled_asset_name = None - - -class Datastore(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.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(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.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, "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", "ModelDataCollector". - :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", "ModelDataCollector". - :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 locations: Locations where the job can run. - :vartype locations: list[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"}, - "locations": {"key": "locations", "type": "[str]"}, - "properties": {"key": "properties", "type": "{object}"}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - locations: Optional[List[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 locations: Locations where the job can run. - :paramtype locations: list[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.locations = locations - 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 locations: Locations where the job can run. - :vartype locations: list[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"}, - "locations": {"key": "locations", "type": "[str]"}, - "properties": {"key": "properties", "type": "{object}"}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - locations: Optional[List[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 locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(DeploymentResourceConfiguration, self).__init__( - instance_count=instance_count, - instance_type=instance_type, - locations=locations, - properties=properties, - **kwargs - ) - - -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 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 EncryptionKeyVaultProperties(msrest.serialization.Model): - """EncryptionKeyVaultProperties. - - 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(EncryptionKeyVaultProperties, 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 EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): - """EncryptionKeyVaultUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_identifier: Required. Key Vault uri to access the encryption key. - :vartype key_identifier: str - """ - - _validation = { - "key_identifier": {"required": True}, - } - - _attribute_map = { - "key_identifier": {"key": "keyIdentifier", "type": "str"}, - } - - def __init__(self, *, key_identifier: str, **kwargs): - """ - :keyword key_identifier: Required. Key Vault uri to access the encryption key. - :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 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.EncryptionKeyVaultProperties - """ - - _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": "EncryptionKeyVaultProperties"}, - } - - def __init__( - self, - *, - status: Union[str, "EncryptionStatus"], - key_vault_properties: "EncryptionKeyVaultProperties", - identity: Optional["IdentityForCmk"] = 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.EncryptionKeyVaultProperties - """ - super(EncryptionProperty, self).__init__(**kwargs) - self.status = status - self.identity = identity - self.key_vault_properties = key_vault_properties - - -class EncryptionUpdateProperties(msrest.serialization.Model): - """EncryptionUpdateProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar key_vault_properties: Required. Customer Key vault properties. - :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. Customer Key vault properties. - :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 ScheduleActionBase(msrest.serialization.Model): - """ScheduleActionBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobScheduleAction, 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". - :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", "InvokeBatchEndpoint": "EndpointScheduleAction"}} - - def __init__(self, **kwargs): - """ """ - super(ScheduleActionBase, self).__init__(**kwargs) - self.action_type = None # type: Optional[str] - - -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". - :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(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.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(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.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 - """ - - _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"}, - } - - 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, - **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 - """ - 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 - - -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.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 Feature(msrest.serialization.Model): - """Dto object representing feature. - - :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 description: Specifies description. - :vartype description: str - :ivar feature_name: Specifies name. - :vartype feature_name: str - :ivar tags: A set of tags. Specifies tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - "data_type": {"key": "dataType", "type": "str"}, - "description": {"key": "description", "type": "str"}, - "feature_name": {"key": "featureName", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__( - self, - *, - data_type: Optional[Union[str, "FeatureDataType"]] = None, - description: Optional[str] = None, - feature_name: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :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 description: Specifies description. - :paramtype description: str - :keyword feature_name: Specifies name. - :paramtype feature_name: str - :keyword tags: A set of tags. Specifies tags. - :paramtype tags: dict[str, str] - """ - super(Feature, self).__init__(**kwargs) - self.data_type = data_type - self.description = description - self.feature_name = feature_name - self.tags = tags - - -class FeatureArmPaginatedResult(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(FeatureArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class FeaturesetContainer(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.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 FeaturesetJob(msrest.serialization.Model): - """Dto object representing the feature set job. - - :ivar created_date: Specifies the created date. - :vartype created_date: ~datetime.datetime - :ivar display_name: Specifies the display name. - :vartype display_name: str - :ivar duration: Specifies the duration. - :vartype duration: ~datetime.timedelta - :ivar experiment_id: Specifies the experiment id. - :vartype experiment_id: str - :ivar feature_window: Specifies the backfill feature window to be materialized. - :vartype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :ivar job_id: Specifies the job id. - :vartype job_id: str - :ivar status: Specifies the job status. 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 tags: A set of tags. Specifies the tags if any. - :vartype tags: dict[str, str] - :ivar type: Specifies the feature store job type. Possible values include: - "RecurrentMaterialization", "BackfillMaterialization". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.FeaturestoreJobType - """ - - _attribute_map = { - "created_date": {"key": "createdDate", "type": "iso-8601"}, - "display_name": {"key": "displayName", "type": "str"}, - "duration": {"key": "duration", "type": "duration"}, - "experiment_id": {"key": "experimentId", "type": "str"}, - "feature_window": {"key": "featureWindow", "type": "FeatureWindow"}, - "job_id": {"key": "jobId", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__( - self, - *, - created_date: Optional[datetime.datetime] = None, - display_name: Optional[str] = None, - duration: Optional[datetime.timedelta] = None, - experiment_id: Optional[str] = None, - feature_window: Optional["FeatureWindow"] = None, - job_id: Optional[str] = None, - status: Optional[Union[str, "JobStatus"]] = None, - tags: Optional[Dict[str, str]] = None, - type: Optional[Union[str, "FeaturestoreJobType"]] = None, - **kwargs - ): - """ - :keyword created_date: Specifies the created date. - :paramtype created_date: ~datetime.datetime - :keyword display_name: Specifies the display name. - :paramtype display_name: str - :keyword duration: Specifies the duration. - :paramtype duration: ~datetime.timedelta - :keyword experiment_id: Specifies the experiment id. - :paramtype experiment_id: str - :keyword feature_window: Specifies the backfill feature window to be materialized. - :paramtype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :keyword job_id: Specifies the job id. - :paramtype job_id: str - :keyword status: Specifies the job status. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :keyword tags: A set of tags. Specifies the tags if any. - :paramtype tags: dict[str, str] - :keyword type: Specifies the feature store job type. Possible values include: - "RecurrentMaterialization", "BackfillMaterialization". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.FeaturestoreJobType - """ - super(FeaturesetJob, self).__init__(**kwargs) - self.created_date = created_date - self.display_name = display_name - self.duration = duration - self.experiment_id = experiment_id - self.feature_window = feature_window - self.job_id = job_id - self.status = status - self.tags = tags - self.type = type - - -class FeaturesetJobArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetJob entities. - - :ivar next_link: The link to the next page of FeaturesetJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetJob] - """ - - _attribute_map = { - "next_link": {"key": "nextLink", "type": "str"}, - "value": {"key": "value", "type": "[FeaturesetJob]"}, - } - - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["FeaturesetJob"]] = None, **kwargs): - """ - :keyword next_link: The link to the next page of FeaturesetJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetJob] - """ - super(FeaturesetJobArmPaginatedResult, 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(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.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 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 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 = { - "description": {"key": "description", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "feature_window": {"key": "featureWindow", "type": "FeatureWindow"}, - "resource": {"key": "resource", "type": "MaterializationComputeResource"}, - "spark_configuration": {"key": "sparkConfiguration", "type": "{str}"}, - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - display_name: Optional[str] = None, - feature_window: Optional["FeatureWindow"] = None, - resource: Optional["MaterializationComputeResource"] = None, - spark_configuration: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :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 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.description = description - self.display_name = display_name - self.feature_window = feature_window - 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_id: Job id created as part of request. - :vartype job_id: str - """ - - _attribute_map = { - "job_id": {"key": "jobId", "type": "str"}, - } - - def __init__(self, *, job_id: Optional[str] = None, **kwargs): - """ - :keyword job_id: Job id created as part of request. - :paramtype job_id: str - """ - super(FeaturesetVersionBackfillResponse, self).__init__(**kwargs) - self.job_id = job_id - - -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(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.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(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.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 - """ - - _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"}, - } - - 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, - **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] - """ - 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 - - -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 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 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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"}, - "fixed_parameters": {"key": "fixedParameters", "type": "TableFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "TableVerticalLimitSettings"}, - "n_cross_validations": {"key": "nCrossValidations", "type": "NCrossValidations"}, - "search_space": {"key": "searchSpace", "type": "[TableParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "TableSweepSettings"}, - "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, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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, - fixed_parameters=fixed_parameters, - limit_settings=limit_settings, - n_cross_validations=n_cross_validations, - search_space=search_space, - sweep_settings=sweep_settings, - 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.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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"}, - "training_mode": {"key": "trainingMode", "type": "str"}, - "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, - training_mode: Optional[Union[str, "TrainingMode"]] = 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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, - training_mode=training_mode, - **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 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 GetFeatureRequest(msrest.serialization.Model): - """Request payload to retrieve feature information from a given feature set version. - - :ivar feature_name: Specifies name of the feature. - :vartype feature_name: str - """ - - _attribute_map = { - "feature_name": {"key": "featureName", "type": "str"}, - } - - def __init__(self, *, feature_name: Optional[str] = None, **kwargs): - """ - :keyword feature_name: Specifies name of the feature. - :paramtype feature_name: str - """ - super(GetFeatureRequest, self).__init__(**kwargs) - self.feature_name = feature_name - - -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(DatastoreProperties): - """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 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", "SoftDeleted". - :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, "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 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 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 images. Possible values include: "docker", "azureml". Default value: "docker". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :ivar reference: Image reference URL. - :vartype reference: str - """ - - _attribute_map = { - "additional_properties": {"key": "", "type": "{object}"}, - "type": {"key": "type", "type": "str"}, - "reference": {"key": "reference", "type": "str"}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - type: Optional[Union[str, "ImageType"]] = "docker", - reference: 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 images. Possible values include: "docker", "azureml". Default value: "docker". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :keyword reference: Image reference URL. - :paramtype reference: str - """ - super(Image, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.type = type - self.reference = reference - - -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. - - :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 - """ - - _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"}, - } - - 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 - - -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(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.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 locations: Locations where the job can run. - :vartype locations: list[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"}, - "locations": {"key": "locations", "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, - locations: Optional[List[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 locations: Locations where the job can run. - :paramtype locations: list[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, - locations=locations, - 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". - :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 set by user. - :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 set by user. - :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 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 - - -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 - - -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 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", "SoftDeleted". - :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 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 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"}, - "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, - 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 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.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 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 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"}, - "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, - 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 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, - 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 LabelCategory(msrest.serialization.Model): - """Label category definition. - - :ivar classes: Dictionary of label classes in this category. - :vartype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :ivar display_name: Display name of the label category. - :vartype display_name: str - :ivar multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :vartype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - - _attribute_map = { - "classes": {"key": "classes", "type": "{LabelClass}"}, - "display_name": {"key": "displayName", "type": "str"}, - "multi_select": {"key": "multiSelect", "type": "str"}, - } - - def __init__( - self, - *, - classes: Optional[Dict[str, "LabelClass"]] = None, - display_name: Optional[str] = None, - multi_select: Optional[Union[str, "MultiSelect"]] = None, - **kwargs - ): - """ - :keyword classes: Dictionary of label classes in this category. - :paramtype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :keyword display_name: Display name of the label category. - :paramtype display_name: str - :keyword multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :paramtype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - super(LabelCategory, self).__init__(**kwargs) - self.classes = classes - self.display_name = display_name - self.multi_select = multi_select - - -class LabelClass(msrest.serialization.Model): - """Label class definition. - - :ivar display_name: Display name of the label class. - :vartype display_name: str - :ivar subclasses: Dictionary of subclasses of the label class. - :vartype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - - _attribute_map = { - "display_name": {"key": "displayName", "type": "str"}, - "subclasses": {"key": "subclasses", "type": "{LabelClass}"}, - } - - def __init__( - self, *, display_name: Optional[str] = None, subclasses: Optional[Dict[str, "LabelClass"]] = None, **kwargs - ): - """ - :keyword display_name: Display name of the label class. - :paramtype display_name: str - :keyword subclasses: Dictionary of subclasses of the label class. - :paramtype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - super(LabelClass, self).__init__(**kwargs) - self.display_name = display_name - self.subclasses = subclasses - - -class LabelingDataConfiguration(msrest.serialization.Model): - """Labeling data configuration definition. - - :ivar data_id: Resource Id of the data asset to perform labeling. - :vartype data_id: str - :ivar incremental_data_refresh: Indicates whether to enable incremental data refresh. Possible - values include: "Enabled", "Disabled". - :vartype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - - _attribute_map = { - "data_id": {"key": "dataId", "type": "str"}, - "incremental_data_refresh": {"key": "incrementalDataRefresh", "type": "str"}, - } - - def __init__( - self, - *, - data_id: Optional[str] = None, - incremental_data_refresh: Optional[Union[str, "IncrementalDataRefresh"]] = None, - **kwargs - ): - """ - :keyword data_id: Resource Id of the data asset to perform labeling. - :paramtype data_id: str - :keyword incremental_data_refresh: Indicates whether to enable incremental data refresh. - Possible values include: "Enabled", "Disabled". - :paramtype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - super(LabelingDataConfiguration, self).__init__(**kwargs) - self.data_id = data_id - self.incremental_data_refresh = incremental_data_refresh - - -class LabelingJob(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.LabelingJobProperties - """ - - _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": "LabelingJobProperties"}, - } - - def __init__(self, *, properties: "LabelingJobProperties", **kwargs): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - super(LabelingJob, self).__init__(**kwargs) - self.properties = properties - - -class LabelingJobMediaProperties(msrest.serialization.Model): - """Properties of a labeling job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LabelingJobImageProperties, LabelingJobTextProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - """ - - _validation = { - "media_type": {"required": True}, - } - - _attribute_map = { - "media_type": {"key": "mediaType", "type": "str"}, - } - - _subtype_map = {"media_type": {"Image": "LabelingJobImageProperties", "Text": "LabelingJobTextProperties"}} - - def __init__(self, **kwargs): - """ """ - super(LabelingJobMediaProperties, self).__init__(**kwargs) - self.media_type = None # type: Optional[str] - - -class LabelingJobImageProperties(LabelingJobMediaProperties): - """Properties of a labeling job for image data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - - _validation = { - "media_type": {"required": True}, - } - - _attribute_map = { - "media_type": {"key": "mediaType", "type": "str"}, - "annotation_type": {"key": "annotationType", "type": "str"}, - } - - def __init__(self, *, annotation_type: Optional[Union[str, "ImageAnnotationType"]] = None, **kwargs): - """ - :keyword annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - super(LabelingJobImageProperties, self).__init__(**kwargs) - self.media_type = "Image" # type: str - self.annotation_type = annotation_type - - -class LabelingJobInstructions(msrest.serialization.Model): - """Instructions for labeling job. - - :ivar uri: The link to a page with detailed labeling instructions for labelers. - :vartype uri: str - """ - - _attribute_map = { - "uri": {"key": "uri", "type": "str"}, - } - - def __init__(self, *, uri: Optional[str] = None, **kwargs): - """ - :keyword uri: The link to a page with detailed labeling instructions for labelers. - :paramtype uri: str - """ - super(LabelingJobInstructions, self).__init__(**kwargs) - self.uri = uri - - -class LabelingJobProperties(JobBaseProperties): - """Labeling 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", "Labeling", "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", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar created_date_time: Created time of the job in UTC timezone. - :vartype created_date_time: ~datetime.datetime - :ivar data_configuration: Configuration of data used in the job. - :vartype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :ivar job_instructions: Labeling instructions of the job. - :vartype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :ivar label_categories: Label categories of the job. - :vartype label_categories: dict[str, ~azure.mgmt.machinelearningservices.models.LabelCategory] - :ivar labeling_job_media_properties: Media type specific properties in the job. - :vartype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :ivar ml_assist_configuration: Configuration of MLAssist feature in the job. - :vartype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - :ivar progress_metrics: Progress metrics of the job. - :vartype progress_metrics: ~azure.mgmt.machinelearningservices.models.ProgressMetrics - :ivar project_id: Internal id of the job(Previously called project). - :vartype project_id: str - :ivar provisioning_state: Specifies the labeling job provisioning state. Possible values - include: "Succeeded", "Failed", "Canceled", "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.JobProvisioningState - :ivar status_messages: Status messages of the job. - :vartype status_messages: list[~azure.mgmt.machinelearningservices.models.StatusMessage] - """ - - _validation = { - "job_type": {"required": True}, - "status": {"readonly": True}, - "created_date_time": {"readonly": True}, - "progress_metrics": {"readonly": True}, - "project_id": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "status_messages": {"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"}, - "created_date_time": {"key": "createdDateTime", "type": "iso-8601"}, - "data_configuration": {"key": "dataConfiguration", "type": "LabelingDataConfiguration"}, - "job_instructions": {"key": "jobInstructions", "type": "LabelingJobInstructions"}, - "label_categories": {"key": "labelCategories", "type": "{LabelCategory}"}, - "labeling_job_media_properties": {"key": "labelingJobMediaProperties", "type": "LabelingJobMediaProperties"}, - "ml_assist_configuration": {"key": "mlAssistConfiguration", "type": "MLAssistConfiguration"}, - "progress_metrics": {"key": "progressMetrics", "type": "ProgressMetrics"}, - "project_id": {"key": "projectId", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "status_messages": {"key": "statusMessages", "type": "[StatusMessage]"}, - } - - 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, - data_configuration: Optional["LabelingDataConfiguration"] = None, - job_instructions: Optional["LabelingJobInstructions"] = None, - label_categories: Optional[Dict[str, "LabelCategory"]] = None, - labeling_job_media_properties: Optional["LabelingJobMediaProperties"] = None, - ml_assist_configuration: Optional["MLAssistConfiguration"] = 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 data_configuration: Configuration of data used in the job. - :paramtype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :keyword job_instructions: Labeling instructions of the job. - :paramtype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :keyword label_categories: Label categories of the job. - :paramtype label_categories: dict[str, - ~azure.mgmt.machinelearningservices.models.LabelCategory] - :keyword labeling_job_media_properties: Media type specific properties in the job. - :paramtype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :keyword ml_assist_configuration: Configuration of MLAssist feature in the job. - :paramtype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - """ - super(LabelingJobProperties, 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 = "Labeling" # type: str - self.created_date_time = None - self.data_configuration = data_configuration - self.job_instructions = job_instructions - self.label_categories = label_categories - self.labeling_job_media_properties = labeling_job_media_properties - self.ml_assist_configuration = ml_assist_configuration - self.progress_metrics = None - self.project_id = None - self.provisioning_state = None - self.status_messages = None - - -class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of LabelingJob entities. - - :ivar next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type LabelingJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - - _attribute_map = { - "next_link": {"key": "nextLink", "type": "str"}, - "value": {"key": "value", "type": "[LabelingJob]"}, - } - - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["LabelingJob"]] = None, **kwargs): - """ - :keyword next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type LabelingJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - super(LabelingJobResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class LabelingJobTextProperties(LabelingJobMediaProperties): - """Properties of a labeling job for text data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - - _validation = { - "media_type": {"required": True}, - } - - _attribute_map = { - "media_type": {"key": "mediaType", "type": "str"}, - "annotation_type": {"key": "annotationType", "type": "str"}, - } - - def __init__(self, *, annotation_type: Optional[Union[str, "TextAnnotationType"]] = None, **kwargs): - """ - :keyword annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - super(LabelingJobTextProperties, self).__init__(**kwargs) - self.media_type = "Text" # type: str - self.annotation_type = annotation_type - - -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 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, "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 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - - _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"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionManagedIdentity"}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionManagedIdentity"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__( - category=category, target=target, value=value, value_format=value_format, **kwargs - ) - self.auth_type = "ManagedIdentity" # type: str - self.credentials = credentials - - -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 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 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"}, - "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, - 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 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, - 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 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 MLAssistConfiguration(msrest.serialization.Model): - """Labeling MLAssist configuration definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLAssistConfigurationDisabled, MLAssistConfigurationEnabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - "ml_assist": {"required": True}, - } - - _attribute_map = { - "ml_assist": {"key": "mlAssist", "type": "str"}, - } - - _subtype_map = { - "ml_assist": {"Disabled": "MLAssistConfigurationDisabled", "Enabled": "MLAssistConfigurationEnabled"} - } - - def __init__(self, **kwargs): - """ """ - super(MLAssistConfiguration, self).__init__(**kwargs) - self.ml_assist = None # type: Optional[str] - - -class MLAssistConfigurationDisabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is disabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - "ml_assist": {"required": True}, - } - - _attribute_map = { - "ml_assist": {"key": "mlAssist", "type": "str"}, - } - - def __init__(self, **kwargs): - """ """ - super(MLAssistConfigurationDisabled, self).__init__(**kwargs) - self.ml_assist = "Disabled" # type: str - - -class MLAssistConfigurationEnabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is enabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - :ivar inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :vartype inferencing_compute_binding: str - :ivar training_compute_binding: Required. [Required] AML compute binding used in training. - :vartype training_compute_binding: str - """ - - _validation = { - "ml_assist": {"required": True}, - "inferencing_compute_binding": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, - "training_compute_binding": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, - } - - _attribute_map = { - "ml_assist": {"key": "mlAssist", "type": "str"}, - "inferencing_compute_binding": {"key": "inferencingComputeBinding", "type": "str"}, - "training_compute_binding": {"key": "trainingComputeBinding", "type": "str"}, - } - - def __init__(self, *, inferencing_compute_binding: str, training_compute_binding: str, **kwargs): - """ - :keyword inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :paramtype inferencing_compute_binding: str - :keyword training_compute_binding: Required. [Required] AML compute binding used in training. - :paramtype training_compute_binding: str - """ - super(MLAssistConfigurationEnabled, self).__init__(**kwargs) - self.ml_assist = "Enabled" # type: str - self.inferencing_compute_binding = inferencing_compute_binding - self.training_compute_binding = training_compute_binding - - -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, "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 asset_version: Output Asset Version. - :vartype asset_version: 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"}, - "asset_version": {"key": "assetVersion", "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, - asset_version: 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 asset_version: Output Asset Version. - :paramtype asset_version: 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, asset_version=asset_version, mode=mode, uri=uri, **kwargs - ) - self.asset_name = asset_name - self.asset_version = asset_version - 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, "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, "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 asset_version: Output Asset Version. - :vartype asset_version: 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"}, - "asset_version": {"key": "assetVersion", "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, - asset_version: 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 asset_version: Output Asset Version. - :paramtype asset_version: 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, asset_version=asset_version, mode=mode, uri=uri, **kwargs - ) - self.asset_name = asset_name - self.asset_version = asset_version - self.mode = mode - self.uri = uri - self.job_output_type = "mltable" # type: str - self.description = description - - -class ModelConfiguration(msrest.serialization.Model): - """Model configuration options. - - :ivar mode: Input delivery mode for the model. Possible values include: "ReadOnlyMount", - "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mounting path of the model in the target image. - :vartype mount_path: str - """ - - _attribute_map = { - "mode": {"key": "mode", "type": "str"}, - "mount_path": {"key": "mountPath", "type": "str"}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "PackageInputDeliveryMode"]] = None, - mount_path: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input delivery mode for the model. Possible values include: "ReadOnlyMount", - "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mounting path of the model in the target image. - :paramtype mount_path: str - """ - super(ModelConfiguration, self).__init__(**kwargs) - self.mode = mode - self.mount_path = mount_path - - -class ModelContainer(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.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 ModelPackageInput(msrest.serialization.Model): - """Model package input options. - - All required parameters must be populated in order to send to Azure. - - :ivar input_type: Required. [Required] Type of the input included in the target image. Possible - values include: "UriFile", "UriFolder". - :vartype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :ivar mode: Input delivery mode of the input. Possible values include: "ReadOnlyMount", - "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mount path of the input in the target image. - :vartype mount_path: str - :ivar path: Required. [Required] Location of the input. - :vartype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - - _validation = { - "input_type": {"required": True}, - "path": {"required": True}, - } - - _attribute_map = { - "input_type": {"key": "inputType", "type": "str"}, - "mode": {"key": "mode", "type": "str"}, - "mount_path": {"key": "mountPath", "type": "str"}, - "path": {"key": "path", "type": "PackageInputPathBase"}, - } - - def __init__( - self, - *, - input_type: Union[str, "PackageInputType"], - path: "PackageInputPathBase", - mode: Optional[Union[str, "PackageInputDeliveryMode"]] = None, - mount_path: Optional[str] = None, - **kwargs - ): - """ - :keyword input_type: Required. [Required] Type of the input included in the target image. - Possible values include: "UriFile", "UriFolder". - :paramtype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :keyword mode: Input delivery mode of the input. Possible values include: "ReadOnlyMount", - "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mount path of the input in the target image. - :paramtype mount_path: str - :keyword path: Required. [Required] Location of the input. - :paramtype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - super(ModelPackageInput, self).__init__(**kwargs) - self.input_type = input_type - self.mode = mode - self.mount_path = mount_path - self.path = path - - -class ModelVersion(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.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 - """ - - _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"}, - } - - 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, - **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 - """ - 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 - - -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 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 NlpFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML NLP training. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: int - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: int - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: int - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: int - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: float - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: float - """ - - _attribute_map = { - "gradient_accumulation_steps": {"key": "gradientAccumulationSteps", "type": "int"}, - "learning_rate": {"key": "learningRate", "type": "float"}, - "learning_rate_scheduler": {"key": "learningRateScheduler", "type": "str"}, - "model_name": {"key": "modelName", "type": "str"}, - "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, - "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, - "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, - "warmup_ratio": {"key": "warmupRatio", "type": "float"}, - "weight_decay": {"key": "weightDecay", "type": "float"}, - } - - def __init__( - self, - *, - gradient_accumulation_steps: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "NlpLearningRateScheduler"]] = None, - model_name: Optional[str] = None, - number_of_epochs: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_ratio: Optional[float] = None, - weight_decay: Optional[float] = None, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: int - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: int - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: int - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: int - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: float - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: float - """ - super(NlpFixedParameters, self).__init__(**kwargs) - self.gradient_accumulation_steps = gradient_accumulation_steps - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.number_of_epochs = number_of_epochs - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_ratio = warmup_ratio - self.weight_decay = weight_decay - - -class NlpParameterSubspace(msrest.serialization.Model): - """Stringified search spaces for each parameter. See below examples. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :vartype learning_rate_scheduler: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: str - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: str - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: str - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: str - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: str - """ - - _attribute_map = { - "gradient_accumulation_steps": {"key": "gradientAccumulationSteps", "type": "str"}, - "learning_rate": {"key": "learningRate", "type": "str"}, - "learning_rate_scheduler": {"key": "learningRateScheduler", "type": "str"}, - "model_name": {"key": "modelName", "type": "str"}, - "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, - "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, - "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, - "warmup_ratio": {"key": "warmupRatio", "type": "str"}, - "weight_decay": {"key": "weightDecay", "type": "str"}, - } - - def __init__( - self, - *, - gradient_accumulation_steps: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - number_of_epochs: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_ratio: Optional[str] = None, - weight_decay: Optional[str] = None, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :paramtype learning_rate_scheduler: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: str - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: str - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: str - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: str - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: str - """ - super(NlpParameterSubspace, self).__init__(**kwargs) - self.gradient_accumulation_steps = gradient_accumulation_steps - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.number_of_epochs = number_of_epochs - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_ratio = warmup_ratio - self.weight_decay = weight_decay - - -class NlpSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter tuning related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. 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 for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(NlpSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.sampling_algorithm = sampling_algorithm - - -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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - "featurization_settings": {"key": "featurizationSettings", "type": "NlpVerticalFeaturizationSettings"}, - "fixed_parameters": {"key": "fixedParameters", "type": "NlpFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "NlpVerticalLimitSettings"}, - "search_space": {"key": "searchSpace", "type": "[NlpParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, - } - - def __init__( - self, - *, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_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_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Timeout for individual HD trials. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, - "max_nodes": {"key": "maxNodes", "type": "int"}, - "max_trials": {"key": "maxTrials", "type": "int"}, - "timeout": {"key": "timeout", "type": "duration"}, - "trial_timeout": {"key": "trialTimeout", "type": "duration"}, - } - - def __init__( - self, - *, - max_concurrent_trials: Optional[int] = 1, - max_nodes: Optional[int] = 1, - max_trials: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "P7D", - trial_timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Timeout for individual HD trials. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = max_concurrent_trials - self.max_nodes = max_nodes - self.max_trials = max_trials - self.timeout = timeout - self.trial_timeout = trial_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. - - 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 - """ - - _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"}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 - """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__( - category=category, target=target, value=value, value_format=value_format, **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", "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 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 NotificationSetting(msrest.serialization.Model): - """Configuration for notification. - - :ivar email_on: Send email notification to user on specified notfication 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 seperator. - :vartype emails: list[str] - """ - - _attribute_map = { - "email_on": {"key": "emailOn", "type": "[str]"}, - "emails": {"key": "emails", "type": "[str]"}, - } - - def __init__( - self, - *, - email_on: Optional[List[Union[str, "EmailNotificationEnableType"]]] = None, - emails: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword email_on: Send email notification to user on specified notfication 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 seperator. - :paramtype emails: list[str] - """ - super(NotificationSetting, self).__init__(**kwargs) - self.email_on = email_on - self.emails = emails - - -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 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 OnlineInferenceConfiguration(msrest.serialization.Model): - """Online inference configuration options. - - :ivar configurations: Additional configurations. - :vartype configurations: dict[str, str] - :ivar entry_script: Entry script or command to invoke. - :vartype entry_script: str - :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 = { - "configurations": {"key": "configurations", "type": "{str}"}, - "entry_script": {"key": "entryScript", "type": "str"}, - "liveness_route": {"key": "livenessRoute", "type": "Route"}, - "readiness_route": {"key": "readinessRoute", "type": "Route"}, - "scoring_route": {"key": "scoringRoute", "type": "Route"}, - } - - def __init__( - self, - *, - configurations: Optional[Dict[str, str]] = None, - entry_script: Optional[str] = None, - liveness_route: Optional["Route"] = None, - readiness_route: Optional["Route"] = None, - scoring_route: Optional["Route"] = None, - **kwargs - ): - """ - :keyword configurations: Additional configurations. - :paramtype configurations: dict[str, str] - :keyword entry_script: Entry script or command to invoke. - :paramtype entry_script: str - :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(OnlineInferenceConfiguration, self).__init__(**kwargs) - self.configurations = configurations - self.entry_script = entry_script - self.liveness_route = liveness_route - self.readiness_route = readiness_route - self.scoring_route = scoring_route - - -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 PackageInputPathBase(msrest.serialization.Model): - """PackageInputPathBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: PackageInputPathId, PackageInputPathVersion, PackageInputPathUrl. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - """ - - _validation = { - "input_path_type": {"required": True}, - } - - _attribute_map = { - "input_path_type": {"key": "inputPathType", "type": "str"}, - } - - _subtype_map = { - "input_path_type": { - "PathId": "PackageInputPathId", - "PathVersion": "PackageInputPathVersion", - "Url": "PackageInputPathUrl", - } - } - - def __init__(self, **kwargs): - """ """ - super(PackageInputPathBase, self).__init__(**kwargs) - self.input_path_type = None # type: Optional[str] - - -class PackageInputPathId(PackageInputPathBase): - """Package input path specified with a resource id. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_id: Input resource id. - :vartype resource_id: str - """ - - _validation = { - "input_path_type": {"required": True}, - } - - _attribute_map = { - "input_path_type": {"key": "inputPathType", "type": "str"}, - "resource_id": {"key": "resourceId", "type": "str"}, - } - - def __init__(self, *, resource_id: Optional[str] = None, **kwargs): - """ - :keyword resource_id: Input resource id. - :paramtype resource_id: str - """ - super(PackageInputPathId, self).__init__(**kwargs) - self.input_path_type = "PathId" # type: str - self.resource_id = resource_id - - -class PackageInputPathUrl(PackageInputPathBase): - """Package input path specified as an url. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar url: Input path url. - :vartype url: str - """ - - _validation = { - "input_path_type": {"required": True}, - } - - _attribute_map = { - "input_path_type": {"key": "inputPathType", "type": "str"}, - "url": {"key": "url", "type": "str"}, - } - - def __init__(self, *, url: Optional[str] = None, **kwargs): - """ - :keyword url: Input path url. - :paramtype url: str - """ - super(PackageInputPathUrl, self).__init__(**kwargs) - self.input_path_type = "Url" # type: str - self.url = url - - -class PackageInputPathVersion(PackageInputPathBase): - """Package input path specified with name and version. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_name: Input resource name. - :vartype resource_name: str - :ivar resource_version: Input resource version. - :vartype resource_version: str - """ - - _validation = { - "input_path_type": {"required": True}, - } - - _attribute_map = { - "input_path_type": {"key": "inputPathType", "type": "str"}, - "resource_name": {"key": "resourceName", "type": "str"}, - "resource_version": {"key": "resourceVersion", "type": "str"}, - } - - def __init__(self, *, resource_name: Optional[str] = None, resource_version: Optional[str] = None, **kwargs): - """ - :keyword resource_name: Input resource name. - :paramtype resource_name: str - :keyword resource_version: Input resource version. - :paramtype resource_version: str - """ - super(PackageInputPathVersion, self).__init__(**kwargs) - self.input_path_type = "PathVersion" # type: str - self.resource_name = resource_name - self.resource_version = resource_version - - -class PackageRequest(msrest.serialization.Model): - """Model package operation request properties. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Required. [Required] Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_name: Required. [Required] Target environment name to be generated by - package. - :vartype target_environment_name: str - :ivar target_environment_version: Target environment version to be generated by package. - :vartype target_environment_version: str - """ - - _validation = { - "inferencing_server": {"required": True}, - "target_environment_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, - } - - _attribute_map = { - "base_environment_source": {"key": "baseEnvironmentSource", "type": "BaseEnvironmentSource"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, - "inferencing_server": {"key": "inferencingServer", "type": "InferencingServer"}, - "inputs": {"key": "inputs", "type": "[ModelPackageInput]"}, - "model_configuration": {"key": "modelConfiguration", "type": "ModelConfiguration"}, - "tags": {"key": "tags", "type": "{str}"}, - "target_environment_name": {"key": "targetEnvironmentName", "type": "str"}, - "target_environment_version": {"key": "targetEnvironmentVersion", "type": "str"}, - } - - def __init__( - self, - *, - inferencing_server: "InferencingServer", - target_environment_name: str, - base_environment_source: Optional["BaseEnvironmentSource"] = None, - environment_variables: Optional[Dict[str, str]] = None, - inputs: Optional[List["ModelPackageInput"]] = None, - model_configuration: Optional["ModelConfiguration"] = None, - tags: Optional[Dict[str, str]] = None, - target_environment_version: Optional[str] = None, - **kwargs - ): - """ - :keyword base_environment_source: Base environment to start with. - :paramtype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :keyword environment_variables: Collection of environment variables. - :paramtype environment_variables: dict[str, str] - :keyword inferencing_server: Required. [Required] Inferencing server configurations. - :paramtype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :keyword inputs: Collection of inputs. - :paramtype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :keyword model_configuration: Model configuration including the mount mode. - :paramtype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword target_environment_name: Required. [Required] Target environment name to be generated - by package. - :paramtype target_environment_name: str - :keyword target_environment_version: Target environment version to be generated by package. - :paramtype target_environment_version: str - """ - super(PackageRequest, self).__init__(**kwargs) - self.base_environment_source = base_environment_source - self.environment_variables = environment_variables - self.inferencing_server = inferencing_server - self.inputs = inputs - self.model_configuration = model_configuration - self.tags = tags - self.target_environment_name = target_environment_name - self.target_environment_version = target_environment_version - - -class PackageResponse(PackageRequest): - """Package response returned after async package operation completes successfully. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Required. [Required] Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_name: Required. [Required] Target environment name to be generated by - package. - :vartype target_environment_name: str - :ivar target_environment_version: Target environment version to be generated by package. - :vartype target_environment_version: str - :ivar build_id: Build id of the image build operation. - :vartype build_id: str - :ivar build_state: Build state of the image build operation. Possible values include: - "NotStarted", "Running", "Succeeded", "Failed". - :vartype build_state: str or ~azure.mgmt.machinelearningservices.models.PackageBuildState - :ivar log_url: Log url of the image build operation. - :vartype log_url: str - :ivar target_environment_id: Asset ID of the target environment created by package operation. - :vartype target_environment_id: str - """ - - _validation = { - "inferencing_server": {"required": True}, - "target_environment_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, - "build_id": {"readonly": True}, - "build_state": {"readonly": True}, - "log_url": {"readonly": True}, - "target_environment_id": {"readonly": True}, - } - - _attribute_map = { - "base_environment_source": {"key": "baseEnvironmentSource", "type": "BaseEnvironmentSource"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, - "inferencing_server": {"key": "inferencingServer", "type": "InferencingServer"}, - "inputs": {"key": "inputs", "type": "[ModelPackageInput]"}, - "model_configuration": {"key": "modelConfiguration", "type": "ModelConfiguration"}, - "tags": {"key": "tags", "type": "{str}"}, - "target_environment_name": {"key": "targetEnvironmentName", "type": "str"}, - "target_environment_version": {"key": "targetEnvironmentVersion", "type": "str"}, - "build_id": {"key": "buildId", "type": "str"}, - "build_state": {"key": "buildState", "type": "str"}, - "log_url": {"key": "logUrl", "type": "str"}, - "target_environment_id": {"key": "targetEnvironmentId", "type": "str"}, - } - - def __init__( - self, - *, - inferencing_server: "InferencingServer", - target_environment_name: str, - base_environment_source: Optional["BaseEnvironmentSource"] = None, - environment_variables: Optional[Dict[str, str]] = None, - inputs: Optional[List["ModelPackageInput"]] = None, - model_configuration: Optional["ModelConfiguration"] = None, - tags: Optional[Dict[str, str]] = None, - target_environment_version: Optional[str] = None, - **kwargs - ): - """ - :keyword base_environment_source: Base environment to start with. - :paramtype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :keyword environment_variables: Collection of environment variables. - :paramtype environment_variables: dict[str, str] - :keyword inferencing_server: Required. [Required] Inferencing server configurations. - :paramtype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :keyword inputs: Collection of inputs. - :paramtype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :keyword model_configuration: Model configuration including the mount mode. - :paramtype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword target_environment_name: Required. [Required] Target environment name to be generated - by package. - :paramtype target_environment_name: str - :keyword target_environment_version: Target environment version to be generated by package. - :paramtype target_environment_version: str - """ - super(PackageResponse, self).__init__( - base_environment_source=base_environment_source, - environment_variables=environment_variables, - inferencing_server=inferencing_server, - inputs=inputs, - model_configuration=model_configuration, - tags=tags, - target_environment_name=target_environment_name, - target_environment_version=target_environment_version, - **kwargs - ) - self.build_id = None - self.build_state = None - self.log_url = None - self.target_environment_id = 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, *, 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 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.PartialManagedServiceIdentity - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type. - :vartype kind: str - :ivar properties: Additional attributes of the entity. - :vartype properties: any - :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"}, - "properties": {"key": "properties", "type": "object"}, - "sku": {"key": "sku", "type": "PartialSku"}, - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__( - self, - *, - identity: Optional["PartialManagedServiceIdentity"] = None, - kind: Optional[str] = None, - properties: Optional[Any] = 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 properties: Additional attributes of the entity. - :paramtype properties: any - :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.kind = kind - self.properties = properties - 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. - - 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - - _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"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionPersonalAccessToken"}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionPersonalAccessToken"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__( - category=category, target=target, value=value, value_format=value_format, **kwargs - ) - self.auth_type = "PAT" # type: str - self.credentials = credentials - - -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", "Labeling", "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", "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 - :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 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 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 - :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"}, - "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"}, - "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["ManagedServiceIdentity"] = 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.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 - :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.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 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 - :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"}, - "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"}, - "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, - 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.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 - :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.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 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 ProgressMetrics(msrest.serialization.Model): - """Progress metrics definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar completed_datapoint_count: The completed datapoint count. - :vartype completed_datapoint_count: long - :ivar incremental_data_last_refresh_date_time: The time of last successful incremental data - refresh in UTC. - :vartype incremental_data_last_refresh_date_time: ~datetime.datetime - :ivar skipped_datapoint_count: The skipped datapoint count. - :vartype skipped_datapoint_count: long - :ivar total_datapoint_count: The total datapoint count. - :vartype total_datapoint_count: long - """ - - _validation = { - "completed_datapoint_count": {"readonly": True}, - "incremental_data_last_refresh_date_time": {"readonly": True}, - "skipped_datapoint_count": {"readonly": True}, - "total_datapoint_count": {"readonly": True}, - } - - _attribute_map = { - "completed_datapoint_count": {"key": "completedDatapointCount", "type": "long"}, - "incremental_data_last_refresh_date_time": {"key": "incrementalDataLastRefreshDateTime", "type": "iso-8601"}, - "skipped_datapoint_count": {"key": "skippedDatapointCount", "type": "long"}, - "total_datapoint_count": {"key": "totalDatapointCount", "type": "long"}, - } - - def __init__(self, **kwargs): - """ """ - super(ProgressMetrics, self).__init__(**kwargs) - self.completed_datapoint_count = None - self.incremental_data_last_refresh_date_time = None - self.skipped_datapoint_count = None - self.total_datapoint_count = 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, *, 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: Enum to determine the job tier. Possible values include: "Spot", "Basic", - "Standard", "Premium". - :vartype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - :ivar priority: Controls the priority of the job on a compute. - :vartype priority: int - """ - - _attribute_map = { - "job_tier": {"key": "jobTier", "type": "str"}, - "priority": {"key": "priority", "type": "int"}, - } - - def __init__(self, *, job_tier: Optional[Union[str, "JobTier"]] = None, priority: Optional[int] = None, **kwargs): - """ - :keyword job_tier: Enum to determine the job tier. Possible values include: "Spot", "Basic", - "Standard", "Premium". - :paramtype job_tier: str or ~azure.mgmt.machinelearningservices.models.JobTier - :keyword priority: Controls the priority of the job on a compute. - :paramtype priority: int - """ - super(QueueSettings, self).__init__(**kwargs) - self.job_tier = job_tier - self.priority = priority - - -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 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 logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :vartype logbase: str - :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"}, - "logbase": {"key": "logbase", "type": "str"}, - "rule": {"key": "rule", "type": "str"}, - "seed": {"key": "seed", "type": "int"}, - } - - def __init__( - self, - *, - logbase: Optional[str] = None, - rule: Optional[Union[str, "RandomSamplingAlgorithmRule"]] = None, - seed: Optional[int] = None, - **kwargs - ): - """ - :keyword logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :paramtype logbase: str - :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.logbase = logbase - self.rule = rule - self.seed = seed - - -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 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 properties: Required. [Required] Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.RegistryProperties - :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": "RegistryProperties"}, - "sku": {"key": "sku", "type": "Sku"}, - } - - def __init__( - self, - *, - location: str, - properties: "RegistryProperties", - 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.RegistryProperties - :keyword sku: Sku details required for ARM contract for Autoscaling. - :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku - """ - super(Registry, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.kind = kind - self.properties = properties - self.sku = sku - - -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 RegistryProperties(ResourceBase): - """Details of the Registry. - - :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 public_network_access: - :vartype public_network_access: str - :ivar discovery_url: - :vartype discovery_url: str - :ivar intellectual_property_publisher: - :vartype intellectual_property_publisher: str - :ivar managed_resource_group: Managed resource group created for the registry. - :vartype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar ml_flow_registry_uri: - :vartype ml_flow_registry_uri: str - :ivar private_link_count: - :vartype private_link_count: int - :ivar region_details: Details of each region the registry is in. - :vartype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - :ivar managed_resource_group_tags: Tags to be applied to the managed resource group associated - with this registry. - :vartype managed_resource_group_tags: dict[str, str] - """ - - _attribute_map = { - "description": {"key": "description", "type": "str"}, - "properties": {"key": "properties", "type": "{str}"}, - "tags": {"key": "tags", "type": "{str}"}, - "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, - "discovery_url": {"key": "discoveryUrl", "type": "str"}, - "intellectual_property_publisher": {"key": "intellectualPropertyPublisher", "type": "str"}, - "managed_resource_group": {"key": "managedResourceGroup", "type": "ArmResourceId"}, - "ml_flow_registry_uri": {"key": "mlFlowRegistryUri", "type": "str"}, - "private_link_count": {"key": "privateLinkCount", "type": "int"}, - "region_details": {"key": "regionDetails", "type": "[RegistryRegionArmDetails]"}, - "managed_resource_group_tags": {"key": "managedResourceGroupTags", "type": "{str}"}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - public_network_access: Optional[str] = None, - discovery_url: Optional[str] = None, - intellectual_property_publisher: Optional[str] = None, - managed_resource_group: Optional["ArmResourceId"] = None, - ml_flow_registry_uri: Optional[str] = None, - private_link_count: Optional[int] = None, - region_details: Optional[List["RegistryRegionArmDetails"]] = None, - managed_resource_group_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 public_network_access: - :paramtype public_network_access: str - :keyword discovery_url: - :paramtype discovery_url: str - :keyword intellectual_property_publisher: - :paramtype intellectual_property_publisher: str - :keyword managed_resource_group: Managed resource group created for the registry. - :paramtype managed_resource_group: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword ml_flow_registry_uri: - :paramtype ml_flow_registry_uri: str - :keyword private_link_count: - :paramtype private_link_count: int - :keyword region_details: Details of each region the registry is in. - :paramtype region_details: - list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] - :keyword managed_resource_group_tags: Tags to be applied to the managed resource group - associated with this registry. - :paramtype managed_resource_group_tags: dict[str, str] - """ - super(RegistryProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.public_network_access = public_network_access - self.discovery_url = discovery_url - self.intellectual_property_publisher = intellectual_property_publisher - self.managed_resource_group = managed_resource_group - self.ml_flow_registry_uri = ml_flow_registry_uri - self.private_link_count = private_link_count - self.region_details = region_details - self.managed_resource_group_tags = managed_resource_group_tags - - -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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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"}, - "fixed_parameters": {"key": "fixedParameters", "type": "TableFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "TableVerticalLimitSettings"}, - "n_cross_validations": {"key": "nCrossValidations", "type": "NCrossValidations"}, - "search_space": {"key": "searchSpace", "type": "[TableParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "TableSweepSettings"}, - "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, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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, - fixed_parameters=fixed_parameters, - limit_settings=limit_settings, - n_cross_validations=n_cross_validations, - search_space=search_space, - sweep_settings=sweep_settings, - 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.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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"}, - "training_mode": {"key": "trainingMode", "type": "str"}, - "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, - training_mode: Optional[Union[str, "TrainingMode"]] = 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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, - training_mode=training_mode, - **kwargs - ) - self.allowed_training_algorithms = allowed_training_algorithms - self.blocked_training_algorithms = blocked_training_algorithms - - -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 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 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _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"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionSharedAccessSignature"}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionSharedAccessSignature"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__( - category=category, target=target, value=value, value_format=value_format, **kwargs - ) - self.auth_type = "SAS" # type: str - self.credentials = credentials - - -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 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(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.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 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 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - - _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"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionServicePrincipal"}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionServicePrincipal"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__( - category=category, target=target, value=value, value_format=value_format, **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", "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 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 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): - """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 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", "Labeling", "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", "Scheduled". - :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 resource 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 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, "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"}, - "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, - 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 resource 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 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.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 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 StatusMessage(msrest.serialization.Model): - """Active message associated with project. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Service-defined message code. - :vartype code: str - :ivar created_date_time: Time in UTC at which the message was created. - :vartype created_date_time: ~datetime.datetime - :ivar level: Severity level of message. Possible values include: "Error", "Information", - "Warning". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.StatusMessageLevel - :ivar message: A human-readable representation of the message code. - :vartype message: str - """ - - _validation = { - "code": {"readonly": True}, - "created_date_time": {"readonly": True}, - "level": {"readonly": True}, - "message": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "created_date_time": {"key": "createdDateTime", "type": "iso-8601"}, - "level": {"key": "level", "type": "str"}, - "message": {"key": "message", "type": "str"}, - } - - def __init__(self, **kwargs): - """ """ - super(StatusMessage, self).__init__(**kwargs) - self.code = None - self.created_date_time = None - self.level = None - self.message = None - - -class StorageAccountDetails(msrest.serialization.Model): - """Details of storage account to be used for the Registry. - - :ivar system_created_storage_account: - :vartype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :ivar user_created_storage_account: - :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: - :paramtype system_created_storage_account: - ~azure.mgmt.machinelearningservices.models.SystemCreatedStorageAccount - :keyword user_created_storage_account: - :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", "Labeling", "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", "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 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", "SoftDeleted". - :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_sku: - :vartype acr_account_sku: str - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - - _attribute_map = { - "acr_account_sku": {"key": "acrAccountSku", "type": "str"}, - "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, - } - - def __init__( - self, *, acr_account_sku: Optional[str] = None, arm_resource_id: Optional["ArmResourceId"] = None, **kwargs - ): - """ - :keyword acr_account_sku: - :paramtype acr_account_sku: str - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - """ - super(SystemCreatedAcrAccount, self).__init__(**kwargs) - self.acr_account_sku = acr_account_sku - self.arm_resource_id = arm_resource_id - - -class SystemCreatedStorageAccount(msrest.serialization.Model): - """SystemCreatedStorageAccount. - - :ivar arm_resource_id: ARM ResourceId of a resource. - :vartype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :ivar storage_account_hns_enabled: - :vartype storage_account_hns_enabled: bool - :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 - :ivar allow_blob_public_access: - :vartype allow_blob_public_access: bool - """ - - _attribute_map = { - "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, - "storage_account_hns_enabled": {"key": "storageAccountHnsEnabled", "type": "bool"}, - "storage_account_type": {"key": "storageAccountType", "type": "str"}, - "allow_blob_public_access": {"key": "allowBlobPublicAccess", "type": "bool"}, - } - - def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - storage_account_hns_enabled: Optional[bool] = None, - storage_account_type: Optional[str] = None, - allow_blob_public_access: Optional[bool] = None, - **kwargs - ): - """ - :keyword arm_resource_id: ARM ResourceId of a resource. - :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId - :keyword storage_account_hns_enabled: - :paramtype storage_account_hns_enabled: bool - :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 - :keyword allow_blob_public_access: - :paramtype allow_blob_public_access: bool - """ - super(SystemCreatedStorageAccount, self).__init__(**kwargs) - self.arm_resource_id = arm_resource_id - self.storage_account_hns_enabled = storage_account_hns_enabled - self.storage_account_type = storage_account_type - self.allow_blob_public_access = allow_blob_public_access - - -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 TableFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML Table training. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: int - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: int - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: int - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: int - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: float - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: int - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: int - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: float - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: float - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: float - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: float - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: bool - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: bool - """ - - _attribute_map = { - "booster": {"key": "booster", "type": "str"}, - "boosting_type": {"key": "boostingType", "type": "str"}, - "grow_policy": {"key": "growPolicy", "type": "str"}, - "learning_rate": {"key": "learningRate", "type": "float"}, - "max_bin": {"key": "maxBin", "type": "int"}, - "max_depth": {"key": "maxDepth", "type": "int"}, - "max_leaves": {"key": "maxLeaves", "type": "int"}, - "min_data_in_leaf": {"key": "minDataInLeaf", "type": "int"}, - "min_split_gain": {"key": "minSplitGain", "type": "float"}, - "model_name": {"key": "modelName", "type": "str"}, - "n_estimators": {"key": "nEstimators", "type": "int"}, - "num_leaves": {"key": "numLeaves", "type": "int"}, - "preprocessor_name": {"key": "preprocessorName", "type": "str"}, - "reg_alpha": {"key": "regAlpha", "type": "float"}, - "reg_lambda": {"key": "regLambda", "type": "float"}, - "subsample": {"key": "subsample", "type": "float"}, - "subsample_freq": {"key": "subsampleFreq", "type": "float"}, - "tree_method": {"key": "treeMethod", "type": "str"}, - "with_mean": {"key": "withMean", "type": "bool"}, - "with_std": {"key": "withStd", "type": "bool"}, - } - - def __init__( - self, - *, - booster: Optional[str] = None, - boosting_type: Optional[str] = None, - grow_policy: Optional[str] = None, - learning_rate: Optional[float] = None, - max_bin: Optional[int] = None, - max_depth: Optional[int] = None, - max_leaves: Optional[int] = None, - min_data_in_leaf: Optional[int] = None, - min_split_gain: Optional[float] = None, - model_name: Optional[str] = None, - n_estimators: Optional[int] = None, - num_leaves: Optional[int] = None, - preprocessor_name: Optional[str] = None, - reg_alpha: Optional[float] = None, - reg_lambda: Optional[float] = None, - subsample: Optional[float] = None, - subsample_freq: Optional[float] = None, - tree_method: Optional[str] = None, - with_mean: Optional[bool] = False, - with_std: Optional[bool] = False, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: int - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: int - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: int - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: int - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: float - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: int - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: int - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: float - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: float - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: float - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: float - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: bool - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: bool - """ - super(TableFixedParameters, self).__init__(**kwargs) - self.booster = booster - self.boosting_type = boosting_type - self.grow_policy = grow_policy - self.learning_rate = learning_rate - self.max_bin = max_bin - self.max_depth = max_depth - self.max_leaves = max_leaves - self.min_data_in_leaf = min_data_in_leaf - self.min_split_gain = min_split_gain - self.model_name = model_name - self.n_estimators = n_estimators - self.num_leaves = num_leaves - self.preprocessor_name = preprocessor_name - self.reg_alpha = reg_alpha - self.reg_lambda = reg_lambda - self.subsample = subsample - self.subsample_freq = subsample_freq - self.tree_method = tree_method - self.with_mean = with_mean - self.with_std = with_std - - -class TableParameterSubspace(msrest.serialization.Model): - """TableParameterSubspace. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: str - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: str - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: str - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: str - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: str - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: str - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: str - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: str - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: str - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: str - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: str - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: str - """ - - _attribute_map = { - "booster": {"key": "booster", "type": "str"}, - "boosting_type": {"key": "boostingType", "type": "str"}, - "grow_policy": {"key": "growPolicy", "type": "str"}, - "learning_rate": {"key": "learningRate", "type": "str"}, - "max_bin": {"key": "maxBin", "type": "str"}, - "max_depth": {"key": "maxDepth", "type": "str"}, - "max_leaves": {"key": "maxLeaves", "type": "str"}, - "min_data_in_leaf": {"key": "minDataInLeaf", "type": "str"}, - "min_split_gain": {"key": "minSplitGain", "type": "str"}, - "model_name": {"key": "modelName", "type": "str"}, - "n_estimators": {"key": "nEstimators", "type": "str"}, - "num_leaves": {"key": "numLeaves", "type": "str"}, - "preprocessor_name": {"key": "preprocessorName", "type": "str"}, - "reg_alpha": {"key": "regAlpha", "type": "str"}, - "reg_lambda": {"key": "regLambda", "type": "str"}, - "subsample": {"key": "subsample", "type": "str"}, - "subsample_freq": {"key": "subsampleFreq", "type": "str"}, - "tree_method": {"key": "treeMethod", "type": "str"}, - "with_mean": {"key": "withMean", "type": "str"}, - "with_std": {"key": "withStd", "type": "str"}, - } - - def __init__( - self, - *, - booster: Optional[str] = None, - boosting_type: Optional[str] = None, - grow_policy: Optional[str] = None, - learning_rate: Optional[str] = None, - max_bin: Optional[str] = None, - max_depth: Optional[str] = None, - max_leaves: Optional[str] = None, - min_data_in_leaf: Optional[str] = None, - min_split_gain: Optional[str] = None, - model_name: Optional[str] = None, - n_estimators: Optional[str] = None, - num_leaves: Optional[str] = None, - preprocessor_name: Optional[str] = None, - reg_alpha: Optional[str] = None, - reg_lambda: Optional[str] = None, - subsample: Optional[str] = None, - subsample_freq: Optional[str] = None, - tree_method: Optional[str] = None, - with_mean: Optional[str] = None, - with_std: Optional[str] = None, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: str - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: str - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: str - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: str - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: str - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: str - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: str - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: str - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: str - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: str - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: str - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: str - """ - super(TableParameterSubspace, self).__init__(**kwargs) - self.booster = booster - self.boosting_type = boosting_type - self.grow_policy = grow_policy - self.learning_rate = learning_rate - self.max_bin = max_bin - self.max_depth = max_depth - self.max_leaves = max_leaves - self.min_data_in_leaf = min_data_in_leaf - self.min_split_gain = min_split_gain - self.model_name = model_name - self.n_estimators = n_estimators - self.num_leaves = num_leaves - self.preprocessor_name = preprocessor_name - self.reg_alpha = reg_alpha - self.reg_lambda = reg_lambda - self.subsample = subsample - self.subsample_freq = subsample_freq - self.tree_method = tree_method - self.with_mean = with_mean - self.with_std = with_std - - -class TableSweepSettings(msrest.serialization.Model): - """TableSweepSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. 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 for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(TableSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.sampling_algorithm = sampling_algorithm - - -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_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of iterations. - :vartype max_trials: int - :ivar sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to trigger. - :vartype sweep_concurrent_trials: int - :ivar sweep_trials: Number of sweeping runs that user wants to trigger. - :vartype sweep_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_nodes": {"key": "maxNodes", "type": "int"}, - "max_trials": {"key": "maxTrials", "type": "int"}, - "sweep_concurrent_trials": {"key": "sweepConcurrentTrials", "type": "int"}, - "sweep_trials": {"key": "sweepTrials", "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_nodes: Optional[int] = 1, - max_trials: Optional[int] = 1000, - sweep_concurrent_trials: Optional[int] = 0, - sweep_trials: Optional[int] = 0, - 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_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of iterations. - :paramtype max_trials: int - :keyword sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to - trigger. - :paramtype sweep_concurrent_trials: int - :keyword sweep_trials: Number of sweeping runs that user wants to trigger. - :paramtype sweep_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_nodes = max_nodes - self.max_trials = max_trials - self.sweep_concurrent_trials = sweep_concurrent_trials - self.sweep_trials = sweep_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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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"}, - "fixed_parameters": {"key": "fixedParameters", "type": "NlpFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "NlpVerticalLimitSettings"}, - "search_space": {"key": "searchSpace", "type": "[NlpParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, - "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, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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, - fixed_parameters=fixed_parameters, - limit_settings=limit_settings, - search_space=search_space, - sweep_settings=sweep_settings, - validation_data=validation_data, - **kwargs - ) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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"}, - "fixed_parameters": {"key": "fixedParameters", "type": "NlpFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "NlpVerticalLimitSettings"}, - "search_space": {"key": "searchSpace", "type": "[NlpParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, - "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, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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, - fixed_parameters=fixed_parameters, - limit_settings=limit_settings, - search_space=search_space, - sweep_settings=sweep_settings, - validation_data=validation_data, - **kwargs - ) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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"}, - "fixed_parameters": {"key": "fixedParameters", "type": "NlpFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "NlpVerticalLimitSettings"}, - "search_space": {"key": "searchSpace", "type": "[NlpParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, - "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, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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, - fixed_parameters=fixed_parameters, - limit_settings=limit_settings, - search_space=search_space, - sweep_settings=sweep_settings, - validation_data=validation_data, - **kwargs - ) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_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 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, "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 TritonInferencingServer(InferencingServer): - """Triton inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for Triton. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - "server_type": {"required": True}, - } - - _attribute_map = { - "server_type": {"key": "serverType", "type": "str"}, - "inference_configuration": {"key": "inferenceConfiguration", "type": "OnlineInferenceConfiguration"}, - } - - def __init__(self, *, inference_configuration: Optional["OnlineInferenceConfiguration"] = None, **kwargs): - """ - :keyword inference_configuration: Inference configuration for Triton. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(TritonInferencingServer, self).__init__(**kwargs) - self.server_type = "Triton" # type: str - self.inference_configuration = inference_configuration - - -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, "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 asset_version: Output Asset Version. - :vartype asset_version: 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"}, - "asset_version": {"key": "assetVersion", "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, - asset_version: 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 asset_version: Output Asset Version. - :paramtype asset_version: 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, asset_version=asset_version, mode=mode, uri=uri, **kwargs - ) - self.asset_name = asset_name - self.asset_version = asset_version - 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, "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, "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 asset_version: Output Asset Version. - :vartype asset_version: 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"}, - "asset_version": {"key": "assetVersion", "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, - asset_version: 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 asset_version: Output Asset Version. - :paramtype asset_version: 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, asset_version=asset_version, mode=mode, uri=uri, **kwargs - ) - self.asset_name = asset_name - self.asset_version = asset_version - 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, "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, "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 asset_version: Output Asset Version. - :vartype asset_version: 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"}, - "asset_version": {"key": "assetVersion", "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, - asset_version: 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 asset_version: Output Asset Version. - :paramtype asset_version: 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, asset_version=asset_version, mode=mode, uri=uri, **kwargs - ) - self.asset_name = asset_name - self.asset_version = asset_version - 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. - - 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", "AccessKey". - :vartype auth_type: str or ~azure.mgmt.machinelearningservices.models.ConnectionAuthType - :ivar category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - - _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"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionUsernamePassword"}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - target: Optional[str] = None, - value: Optional[str] = None, - value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionUsernamePassword"] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", - "AzureSynapseAnalytics". - :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 credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__( - category=category, target=target, value=value, value_format=value_format, **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", "SoftDeleted". - :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: 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 - :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. - :vartype application_insights: str - :ivar container_registry: ARM id of the container registry associated with this workspace. - :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", - "SoftDeleted". - :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 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 - :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 soft_deleted_at: The timestamp when the workspace was soft deleted. - :vartype soft_deleted_at: str - :ivar scheduled_purge_date: The timestamp when the soft deleted workspace is going to be - purged. - :vartype scheduled_purge_date: str - :ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :vartype system_datastores_auth_mode: 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}, - "soft_deleted_at": {"readonly": True}, - "scheduled_purge_date": {"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"}, - "tags": {"key": "tags", "type": "{str}"}, - "sku": {"key": "sku", "type": "Sku"}, - "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"}, - "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"}, - "v1_legacy_mode": {"key": "properties.v1LegacyMode", "type": "bool"}, - "soft_deleted_at": {"key": "properties.softDeletedAt", "type": "str"}, - "scheduled_purge_date": {"key": "properties.scheduledPurgeDate", "type": "str"}, - "system_datastores_auth_mode": {"key": "properties.systemDatastoresAuthMode", "type": "str"}, - } - - def __init__( - self, - *, - identity: Optional["ManagedServiceIdentity"] = 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, - 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, - v1_legacy_mode: Optional[bool] = False, - system_datastores_auth_mode: Optional[str] = None, - **kwargs - ): - """ - :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 - :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. - :paramtype application_insights: str - :keyword container_registry: ARM id of the container registry associated with this workspace. - :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 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 - :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 system_datastores_auth_mode: The auth mode used for accessing the system datastores of - the workspace. - :paramtype system_datastores_auth_mode: str - """ - super(Workspace, self).__init__(**kwargs) - self.identity = identity - self.location = location - self.tags = tags - self.sku = sku - 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.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 - self.v1_legacy_mode = v1_legacy_mode - self.soft_deleted_at = None - self.scheduled_purge_date = None - self.system_datastores_auth_mode = system_datastores_auth_mode - - -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 WorkspaceConnectionManagedIdentity(msrest.serialization.Model): - """WorkspaceConnectionManagedIdentity. - - :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(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.resource_id = resource_id - self.client_id = client_id - - -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. - - 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 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 WorkspaceConnectionUsernamePassword(msrest.serialization.Model): - """WorkspaceConnectionUsernamePassword. - - :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(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.username = username - self.password = password - - -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.ManagedServiceIdentity - :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 - :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 encryption: The encryption settings of the workspace. - :vartype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "sku": {"key": "sku", "type": "Sku"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "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"}, - "application_insights": {"key": "properties.applicationInsights", "type": "str"}, - "container_registry": {"key": "properties.containerRegistry", "type": "str"}, - "encryption": {"key": "properties.encryption", "type": "EncryptionUpdateProperties"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - sku: Optional["Sku"] = None, - identity: Optional["ManagedServiceIdentity"] = 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, - application_insights: Optional[str] = None, - container_registry: Optional[str] = None, - encryption: Optional["EncryptionUpdateProperties"] = 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.ManagedServiceIdentity - :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 - :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 encryption: The encryption settings of the workspace. - :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties - """ - 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 - self.application_insights = application_insights - self.container_registry = container_registry - self.encryption = encryption diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/__init__.py deleted file mode 100644 index cbd930017658..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/__init__.py +++ /dev/null @@ -1,97 +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 ._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_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 ._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 ._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 ._labeling_jobs_operations import LabelingJobsOperations -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 - -__all__ = [ - "Operations", - "WorkspacesOperations", - "UsagesOperations", - "VirtualMachineSizesOperations", - "QuotasOperations", - "ComputeOperations", - "PrivateEndpointConnectionsOperations", - "PrivateLinkResourcesOperations", - "WorkspaceConnectionsOperations", - "RegistriesOperations", - "WorkspaceFeaturesOperations", - "RegistryCodeContainersOperations", - "RegistryCodeVersionsOperations", - "RegistryComponentContainersOperations", - "RegistryComponentVersionsOperations", - "RegistryDataContainersOperations", - "RegistryDataVersionsOperations", - "RegistryEnvironmentContainersOperations", - "RegistryEnvironmentVersionsOperations", - "RegistryModelContainersOperations", - "RegistryModelVersionsOperations", - "BatchEndpointsOperations", - "BatchDeploymentsOperations", - "CodeContainersOperations", - "CodeVersionsOperations", - "ComponentContainersOperations", - "ComponentVersionsOperations", - "DataContainersOperations", - "DataVersionsOperations", - "DatastoresOperations", - "EnvironmentContainersOperations", - "EnvironmentVersionsOperations", - "FeaturesetContainersOperations", - "FeaturesetVersionsOperations", - "FeaturestoreEntityContainersOperations", - "FeaturestoreEntityVersionsOperations", - "JobsOperations", - "LabelingJobsOperations", - "ModelContainersOperations", - "ModelVersionsOperations", - "OnlineEndpointsOperations", - "OnlineDeploymentsOperations", - "SchedulesOperations", -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_batch_deployments_operations.py deleted file mode 100644 index 4b9ff3642f0a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_batch_deployments_operations.py +++ /dev/null @@ -1,859 +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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_batch_endpoints_operations.py deleted file mode 100644 index ff19df4c5157..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_batch_endpoints_operations.py +++ /dev/null @@ -1,911 +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', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_code_containers_operations.py deleted file mode 100644 index 390e87170049..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_code_containers_operations.py +++ /dev/null @@ -1,496 +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', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_code_versions_operations.py deleted file mode 100644 index 75708494a685..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_code_versions_operations.py +++ /dev/null @@ -1,537 +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 - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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}/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'), - "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 = kwargs.pop('api_version', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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 - """ - api_version = kwargs.pop("api_version", "2023-02-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, - 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, - 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", "2023-02-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", "2023-02-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", "2023-02-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_component_containers_operations.py deleted file mode 100644 index 95a87dfa3201..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_component_containers_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.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', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_component_versions_operations.py deleted file mode 100644 index 4e975f54e4e3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_component_versions_operations.py +++ /dev/null @@ -1,545 +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 - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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 - """ - api_version = kwargs.pop("api_version", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_compute_operations.py deleted file mode 100644 index 7c899b83b299..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_compute_operations.py +++ /dev/null @@ -1,1656 +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', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_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', "2023-02-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'), - "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 - api_version = kwargs.pop('api_version', "2023-02-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'), - "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 - api_version = kwargs.pop('api_version', "2023-02-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'), - "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 - api_version = kwargs.pop('api_version', "2023-02-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'), - "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_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', "2023-02-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'), - "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="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', "2023-02-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'), - "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 = kwargs.pop('api_version', "2023-02-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'), - "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 = kwargs.pop('api_version', "2023-02-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'), - "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 = kwargs.pop('api_version', "2023-02-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'), - "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 = kwargs.pop('api_version', "2023-02-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'), - "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_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', "2023-02-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'), - "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="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 - """ - api_version = kwargs.pop("api_version", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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 - - 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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_data_containers_operations.py deleted file mode 100644 index b92b8a6ed788..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_data_containers_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.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', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_data_versions_operations.py deleted file mode 100644 index 9a2b854b7857..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_data_versions_operations.py +++ /dev/null @@ -1,557 +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 - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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 - """ - api_version = kwargs.pop("api_version", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_datastores_operations.py deleted file mode 100644 index 51eaa2c89f36..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_datastores_operations.py +++ /dev/null @@ -1,650 +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', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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}/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'), - "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 - """ - api_version = kwargs.pop("api_version", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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 - **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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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, - name=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("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/v2023_02_01_preview/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_environment_containers_operations.py deleted file mode 100644 index 32f4b7f884ff..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_environment_containers_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.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', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_environment_versions_operations.py deleted file mode 100644 index 81857d4993f3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_environment_versions_operations.py +++ /dev/null @@ -1,545 +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 - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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 - """ - api_version = kwargs.pop("api_version", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featureset_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featureset_containers_operations.py deleted file mode 100644 index 0a0b3911a8b3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featureset_containers_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', "2023-02-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"]] - - 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'), - } - - _url = _format_url_section(_url, **path_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') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: 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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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"]] - **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 - :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", "2023-02-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, - 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, - 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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/operations/_featureset_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featureset_versions_operations.py deleted file mode 100644 index 250c25188584..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featureset_versions_operations.py +++ /dev/null @@ -1,1289 +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', "2023-02-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"]] - - 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'), - "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') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: 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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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_get_feature_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', "2023-02-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}/getFeature") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "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] - 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_features_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', "2023-02-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - tags = kwargs.pop('tags', 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}/listFeatures") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "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') - 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') - - # 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_materialization_jobs_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', "2023-02-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - filters = kwargs.pop('filters', None) # type: Optional[str] - feature_window_start = kwargs.pop('feature_window_start', None) # type: Optional[str] - feature_window_end = kwargs.pop('feature_window_end', 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}/listMaterializationJobs") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if filters is not None: - _query_parameters['filters'] = _SERIALIZER.query("filters", filters, 'str') - if feature_window_start is not None: - _query_parameters['featureWindowStart'] = _SERIALIZER.query("feature_window_start", feature_window_start, 'str') - if feature_window_end is not None: - _query_parameters['featureWindowEnd'] = _SERIALIZER.query("feature_window_end", feature_window_end, '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 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"]] - **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 - :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", "2023-02-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, - 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, - 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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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 - - @distributed_trace - def get_feature( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.GetFeatureRequest" - **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 name: Feature set name. This is case-sensitive. - :type name: str - :param version: Feature set version identifier. This is case-sensitive. - :type version: str - :param body: Feature Name request. This is case-sensitive. - :type body: ~azure.mgmt.machinelearningservices.models.GetFeatureRequest - :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", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - - _json = self._serialize.body(body, "GetFeatureRequest") - - request = build_get_feature_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.get_feature.metadata["url"], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_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_feature.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/getFeature"} # type: ignore - - @distributed_trace - def list_features( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - skip=None, # type: Optional[str] - tags=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeatureArmPaginatedResult"] - """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 name: Featureset name. This is case-sensitive. - :type name: str - :param version: Featureset Version identifier. This is case-sensitive. - :type 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeatureArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeatureArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeatureArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop("error_map", {})) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_features_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, - skip=skip, - tags=tags, - template_url=self.list_features.metadata["url"], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_features_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, - skip=skip, - tags=tags, - 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("FeatureArmPaginatedResult", 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_features.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/listFeatures"} # type: ignore - - @distributed_trace - def list_materialization_jobs( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - skip=None, # type: Optional[str] - filters=None, # type: Optional[str] - feature_window_start=None, # type: Optional[str] - feature_window_end=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturesetJobArmPaginatedResult"] - """List materialization Jobs. - - List materialization Jobs. - - :param resource_group_name: The name of the resource group. The name is 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 skip: Continuation token for pagination. - :type skip: str - :param filters: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type filters: str - :param feature_window_start: Start time of the feature window to filter materialization jobs. - :type feature_window_start: str - :param feature_window_end: End time of the feature window to filter materialization jobs. - :type feature_window_end: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetJobArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetJobArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetJobArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop("error_map", {})) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_materialization_jobs_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, - skip=skip, - filters=filters, - feature_window_start=feature_window_start, - feature_window_end=feature_window_end, - template_url=self.list_materialization_jobs.metadata["url"], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_materialization_jobs_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, - skip=skip, - filters=filters, - feature_window_start=feature_window_start, - feature_window_end=feature_window_end, - 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("FeaturesetJobArmPaginatedResult", 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_materialization_jobs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/listMaterializationJobs"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featurestore_entity_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featurestore_entity_containers_operations.py deleted file mode 100644 index f1e8c60c6612..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featurestore_entity_containers_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', "2023-02-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"]] - - 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'), - } - - _url = _format_url_section(_url, **path_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') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: 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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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"]] - **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 - :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", "2023-02-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, - 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, - 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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/operations/_featurestore_entity_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featurestore_entity_versions_operations.py deleted file mode 100644 index 04bc583b4bff..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featurestore_entity_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 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', "2023-02-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"]] - - 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'), - "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') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: 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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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"]] - **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 - :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", "2023-02-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, - 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, - 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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_jobs_operations.py deleted file mode 100644 index fe4d7c9a8a5b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_jobs_operations.py +++ /dev/null @@ -1,756 +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', "2023-02-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"]] - asset_name = kwargs.pop('asset_name', None) # type: Optional[str] - scheduled = kwargs.pop('scheduled', None) # type: Optional[bool] - schedule_id = kwargs.pop('schedule_id', 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'), - } - - _url = _format_url_section(_url, **path_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 asset_name is not None: - _query_parameters['assetName'] = _SERIALIZER.query("asset_name", asset_name, '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 = kwargs.pop('api_version', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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"]] - asset_name=None, # type: Optional[str] - 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 asset_name: Asset name the job's named output is registered with. - :type asset_name: str - :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 - """ - api_version = kwargs.pop("api_version", "2023-02-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, - asset_name=asset_name, - 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, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - asset_name=asset_name, - 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( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=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", "2023-02-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", "2023-02-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", "2023-02-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. - - 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.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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_labeling_jobs_operations.py deleted file mode 100644 index 3fbcd44d231b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_labeling_jobs_operations.py +++ /dev/null @@ -1,1011 +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', "2023-02-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "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 top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, '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_delete_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', "2023-02-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{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'), - "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', "2023-02-01-preview") # type: str - include_job_instructions = kwargs.pop('include_job_instructions', False) # type: Optional[bool] - include_label_categories = kwargs.pop('include_label_categories', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{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'), - "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') - if include_job_instructions is not None: - _query_parameters['includeJobInstructions'] = _SERIALIZER.query("include_job_instructions", include_job_instructions, 'bool') - if include_label_categories is not None: - _query_parameters['includeLabelCategories'] = _SERIALIZER.query("include_label_categories", include_label_categories, '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_create_or_update_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', "2023-02-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}/labelingJobs/{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'), - "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_export_labels_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', "2023-02-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}/labelingJobs/{id}/exportLabels") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "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] - 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_pause_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', "2023-02-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "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 - ) - - -def build_resume_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', "2023-02-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "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 LabelingJobsOperations(object): - """LabelingJobsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration 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] - top=None, # type: Optional[int] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.LabelingJobResourceArmPaginatedResult"] - """Lists labeling jobs in the workspace. - - Lists labeling 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 top: Number of labeling jobs to return. - :type top: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LabelingJobResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 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, - top=top, - 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, - top=top, - 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("LabelingJobResourceArmPaginatedResult", 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}/labelingJobs"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete a labeling job. - - Delete a labeling 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 LabelingJob. - :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", {})) - - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - request = build_delete_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.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}/labelingJobs/{id}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - include_job_instructions=False, # type: Optional[bool] - include_label_categories=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> "_models.LabelingJob" - """Gets a labeling job by name/id. - - Gets a labeling 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 LabelingJob. - :type id: str - :param include_job_instructions: Boolean value to indicate whether to include JobInstructions - in response. - :type include_job_instructions: bool - :param include_label_categories: Boolean value to indicate Whether to include LabelCategories - in response. - :type include_label_categories: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LabelingJob, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJob - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop("error_map", {})) - - api_version = kwargs.pop("api_version", "2023-02-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, - include_job_instructions=include_job_instructions, - include_label_categories=include_label_categories, - 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("LabelingJob", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.LabelingJob" - **kwargs # type: Any - ): - # type: (...) -> "_models.LabelingJob" - cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop("error_map", {})) - - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - - _json = self._serialize.body(body, "LabelingJob") - - request = build_create_or_update_request_initial( - 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_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("LabelingJob", 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("LabelingJob", 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}/labelingJobs/{id}"} # type: ignore - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.LabelingJob" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.LabelingJob"] - """Creates or updates a labeling job (asynchronous). - - Creates or updates a labeling 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 LabelingJob. - :type id: str - :param body: LabelingJob definition object. - :type body: ~azure.mgmt.machinelearningservices.models.LabelingJob - :keyword callable cls: A custom type or function that will be passed the direct response - :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 LabelingJob or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop("api_version", "2023-02-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.LabelingJob"] - lro_delay = kwargs.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, - id=id, - 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("LabelingJob", 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}/labelingJobs/{id}"} # type: ignore - - def _export_labels_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.ExportSummary" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ExportSummary"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.ExportSummary"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop("error_map", {})) - - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - - _json = self._serialize.body(body, "ExportSummary") - - request = build_export_labels_request_initial( - 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._export_labels_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("ExportSummary", 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 - - _export_labels_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - @distributed_trace - def begin_export_labels( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.ExportSummary" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ExportSummary"] - """Export labels from a labeling job (asynchronous). - - Export labels from a labeling 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 LabelingJob. - :type id: str - :param body: The export summary. - :type body: ~azure.mgmt.machinelearningservices.models.ExportSummary - :keyword callable cls: A custom type or function that will be passed the direct response - :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 ExportSummary or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop("api_version", "2023-02-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.ExportSummary"] - lro_delay = kwargs.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._export_labels_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - 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("ExportSummary", 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_export_labels.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - @distributed_trace - def pause( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Pause a labeling job. - - Pause a labeling 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 LabelingJob. - :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", {})) - - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - request = build_pause_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.pause.metadata["url"], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, 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, {}) - - pause.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - - def _resume_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", "2023-02-01-preview") # type: str - - request = build_resume_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._resume_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) - - _resume_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore - - @distributed_trace - def begin_resume( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Resume a labeling job (asynchronous). - - Resume a labeling 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 LabelingJob. - :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", "2023-02-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._resume_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_resume.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_model_containers_operations.py deleted file mode 100644 index 0a010706941c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_model_containers_operations.py +++ /dev/null @@ -1,512 +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', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_model_versions_operations.py deleted file mode 100644 index e2f46f75e7d0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_model_versions_operations.py +++ /dev/null @@ -1,782 +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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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_package_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', "2023-02-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}/package") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "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="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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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 _package_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: Any - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.PackageResponse"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop("error_map", {})) - - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - - _json = self._serialize.body(body, "object") - - request = build_package_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._package_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("PackageResponse", 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 - - _package_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore - - @distributed_trace - def begin_package( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: Any - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.PackageResponse"] - """Model Version Package operation. - - Model Version Package 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 name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Package operation request body. - :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 PackageResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop("api_version", "2023-02-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.PackageResponse"] - lro_delay = kwargs.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._package_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("PackageResponse", 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_package.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_online_deployments_operations.py deleted file mode 100644 index 118cfadee58d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_online_deployments_operations.py +++ /dev/null @@ -1,1123 +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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_online_endpoints_operations.py deleted file mode 100644 index 38f1af9b3b7f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_online_endpoints_operations.py +++ /dev/null @@ -1,1221 +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', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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 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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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/v2023_02_01_preview/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_operations.py deleted file mode 100644 index ef724f1e74d3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_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', "2023-02-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.AmlOperationListResult"] - """Lists all of the available Azure Machine Learning Services 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 AmlOperationListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.AmlOperationListResult"] - error_map = {401: ClientAuthenticationError, 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("AmlOperationListResult", 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/v2023_02_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index aa6d01273b19..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,479 +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( - resource_group_name, # type: str - workspace_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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 = { - "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 = kwargs.pop('api_version', "2023-02-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'), - "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', "2023-02-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'), - "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 = kwargs.pop('api_version', "2023-02-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'), - "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 - """ - api_version = kwargs.pop("api_version", "2023-02-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( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - 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) - - else: - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - 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("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 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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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 - 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", {})) - - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - 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, - 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 - - @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 - """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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_private_link_resources_operations.py deleted file mode 100644 index d18f9a680b6e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,151 +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( - subscription_id, # type: str - resource_group_name, # type: str - workspace_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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", {})) - - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - 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) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, 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/v2023_02_01_preview/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_quotas_operations.py deleted file mode 100644 index 891dac1d5f84..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_quotas_operations.py +++ /dev/null @@ -1,266 +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', "2023-02-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', "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registries_operations.py deleted file mode 100644 index 31bac636596d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registries_operations.py +++ /dev/null @@ -1,868 +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', "2023-02-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/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') - 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 - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("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_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', "2023-02-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\-_]{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 - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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 - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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\-_]{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 - registry_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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\-_]{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 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, - skip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RegistryTrackedResourceArmPaginatedResult"] - """List registries by subscription. - - List registries by 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 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", "2023-02-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, - 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, - 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("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 - skip=None, # type: Optional[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 - :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 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", "2023-02-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, - 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, - 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("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", "2023-02-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 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", "2023-02-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 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", "2023-02-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 - - def _update_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.PartialRegistryPartialTrackedResource" - **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", "2023-02-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_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._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("Registry", 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")) - - deserialized = self._deserialize("Registry", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - - @distributed_trace - def begin_update( - self, - resource_group_name, # type: str - registry_name, # type: str - body, # type: "_models.PartialRegistryPartialTrackedResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_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 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 - :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", "2023-02-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._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": "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_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: (...) -> 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", "2023-02-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, 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("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 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", "2023-02-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_code_containers_operations.py deleted file mode 100644 index 1aea2a730943..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_code_containers_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 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', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_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', "2023-02-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'), - "codeName": _SERIALIZER.url("code_name", code_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 - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - "codeName": _SERIALIZER.url("code_name", code_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 - code_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - "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. - :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", "2023-02-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", "2023-02-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 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. - :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", "2023-02-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 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. - :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", "2023-02-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", "2023-02-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 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. - :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", "2023-02-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/v2023_02_01_preview/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_code_versions_operations.py deleted file mode 100644 index 6336acf43fa4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_code_versions_operations.py +++ /dev/null @@ -1,669 +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', "2023-02-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'), - "codeName": _SERIALIZER.url("code_name", code_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 - registry_name, # type: str - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - "codeName": _SERIALIZER.url("code_name", code_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 - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - "codeName": _SERIALIZER.url("code_name", code_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 - code_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - "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 - ) - -# 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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_component_containers_operations.py deleted file mode 100644 index 771095a26614..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_component_containers_operations.py +++ /dev/null @@ -1,625 +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', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_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', "2023-02-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'), - "componentName": _SERIALIZER.url("component_name", component_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 - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - "componentName": _SERIALIZER.url("component_name", component_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 - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - "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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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/v2023_02_01_preview/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_component_versions_operations.py deleted file mode 100644 index ca55b40a4296..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_component_versions_operations.py +++ /dev/null @@ -1,670 +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', "2023-02-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'), - "componentName": _SERIALIZER.url("component_name", component_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 - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - "componentName": _SERIALIZER.url("component_name", component_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 - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - "componentName": _SERIALIZER.url("component_name", component_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 - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - "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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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/v2023_02_01_preview/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_data_containers_operations.py deleted file mode 100644 index e3010671e22b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_data_containers_operations.py +++ /dev/null @@ -1,632 +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', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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 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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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/v2023_02_01_preview/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_data_versions_operations.py deleted file mode 100644 index 8fc22eca1bb1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_data_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 - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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 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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_environment_containers_operations.py deleted file mode 100644 index 0d1541eebb57..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_environment_containers_operations.py +++ /dev/null @@ -1,633 +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', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_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', "2023-02-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'), - "environmentName": _SERIALIZER.url("environment_name", environment_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 - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - "environmentName": _SERIALIZER.url("environment_name", environment_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 - environment_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - "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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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/v2023_02_01_preview/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_environment_versions_operations.py deleted file mode 100644 index f52e2620d0b2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_environment_versions_operations.py +++ /dev/null @@ -1,678 +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', "2023-02-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'), - "environmentName": _SERIALIZER.url("environment_name", environment_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_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', "2023-02-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'), - "environmentName": _SERIALIZER.url("environment_name", environment_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 - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - "environmentName": _SERIALIZER.url("environment_name", environment_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 - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - "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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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/v2023_02_01_preview/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_model_containers_operations.py deleted file mode 100644 index a834b186b8b1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_model_containers_operations.py +++ /dev/null @@ -1,633 +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', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_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', "2023-02-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'), - "modelName": _SERIALIZER.url("model_name", model_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 - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - "modelName": _SERIALIZER.url("model_name", model_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 - model_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - "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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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/v2023_02_01_preview/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_model_versions_operations.py deleted file mode 100644 index a56c00290bde..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_model_versions_operations.py +++ /dev/null @@ -1,711 +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', "2023-02-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'), - "modelName": _SERIALIZER.url("model_name", model_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 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', "2023-02-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'), - "modelName": _SERIALIZER.url("model_name", model_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 - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - "modelName": _SERIALIZER.url("model_name", model_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 - model_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-02-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'), - "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 - ) - -# 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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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. - :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", "2023-02-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", "2023-02-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. - :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", "2023-02-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_schedules_operations.py deleted file mode 100644 index 1dc69f67c467..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_schedules_operations.py +++ /dev/null @@ -1,631 +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', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_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', "2023-02-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'), - "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', "2023-02-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'), - "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', "2023-02-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'), - "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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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", "2023-02-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/v2023_02_01_preview/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_usages_operations.py deleted file mode 100644 index b0b04198e12a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_usages_operations.py +++ /dev/null @@ -1,171 +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', "2023-02-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", "2023-02-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/v2023_02_01_preview/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_virtual_machine_sizes_operations.py deleted file mode 100644 index bf145df182ef..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_virtual_machine_sizes_operations.py +++ /dev/null @@ -1,145 +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', "2023-02-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", "2023-02-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/v2023_02_01_preview/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_workspace_connections_operations.py deleted file mode 100644 index a05e78dbaf89..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_workspace_connections_operations.py +++ /dev/null @@ -1,497 +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_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', "2023-02-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'), - "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 = kwargs.pop('api_version', "2023-02-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'), - "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 = kwargs.pop('api_version', "2023-02-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'), - "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 - api_version = kwargs.pop('api_version', "2023-02-01-preview") # type: str - target = kwargs.pop('target', None) # type: Optional[str] - category = kwargs.pop('category', None) # type: Optional[str] - - 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'), - } - - _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", {})) - - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - 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, - 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 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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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 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. - - :param resource_group_name: The name of the resource group. 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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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 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 - """ - api_version = kwargs.pop("api_version", "2023-02-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, - 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, - 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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_workspace_features_operations.py deleted file mode 100644 index e274c9cf39c0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_workspace_features_operations.py +++ /dev/null @@ -1,178 +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', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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", "2023-02-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/v2023_02_01_preview/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_workspaces_operations.py deleted file mode 100644 index 12598b54d570..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_workspaces_operations.py +++ /dev/null @@ -1,1753 +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_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', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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 - api_version = kwargs.pop('api_version', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[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 = kwargs.pop('api_version', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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 - api_version = kwargs.pop('api_version', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[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 - api_version = kwargs.pop('api_version', "2023-02-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") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("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 - api_version = kwargs.pop('api_version', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[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', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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 - api_version = kwargs.pop('api_version', "2023-02-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/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 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 = kwargs.pop('api_version', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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 = kwargs.pop('api_version', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', "2023-02-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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 _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", {})) - - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - 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, - 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 - 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 - """ - api_version = kwargs.pop("api_version", "2023-02-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, - 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("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_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - - def _delete_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", "2023-02-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, - 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) - - 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( # pylint: disable=inconsistent-return-statements - 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 - """ - api_version = kwargs.pop("api_version", "2023-02-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, - 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}"} # 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", {})) - - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - 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, - 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 - 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 - """ - api_version = kwargs.pop("api_version", "2023-02-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, - 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("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 - - @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 - """ - api_version = kwargs.pop("api_version", "2023-02-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, - 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, - 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("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 _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", {})) - - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - 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, - 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 - 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 - """ - api_version = kwargs.pop("api_version", "2023-02-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, - 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("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. - - :param resource_group_name: The name of the resource 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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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 - - 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", "2023-02-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) - - 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( # 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. - - :param resource_group_name: The name of the resource 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 - """ - api_version = kwargs.pop("api_version", "2023-02-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, **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 - - @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 - """ - api_version = kwargs.pop("api_version", "2023-02-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, - 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, - 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("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_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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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 - - 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", "2023-02-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 - 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 - """ - api_version = kwargs.pop("api_version", "2023-02-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 - - @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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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_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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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_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", {})) - - api_version = kwargs.pop("api_version", "2023-02-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 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/py.typed b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/py.typed deleted file mode 100644 index 1242d4327701..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/__init__.py deleted file mode 100644 index da46614477a9..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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/v2023_06_01_preview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/_azure_machine_learning_workspaces.py deleted file mode 100644 index 739388073038..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,268 +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, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, FeaturesOperations, FeaturesetContainersOperations, FeaturesetVersionsOperations, FeaturestoreEntityContainersOperations, FeaturestoreEntityVersionsOperations, JobsOperations, LabelingJobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryDataContainersOperations, RegistryDataVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, 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_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 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 labeling_jobs: LabelingJobsOperations operations - :vartype labeling_jobs: azure.mgmt.machinelearningservices.operations.LabelingJobsOperations - :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 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 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 "2023-06-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_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.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.labeling_jobs = LabelingJobsOperations(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.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.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/v2023_06_01_preview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/_configuration.py deleted file mode 100644 index d6f47209a96d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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 "2023-06-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', "2023-06-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/v2023_06_01_preview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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/v2023_06_01_preview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/_vendor.py deleted file mode 100644 index 138f663c53a4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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/v2023_06_01_preview/_version.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/_version.py deleted file mode 100644 index eae7c95b6fbd..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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/v2023_06_01_preview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/__init__.py deleted file mode 100644 index f67ccda966f1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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/v2023_06_01_preview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/_azure_machine_learning_workspaces.py deleted file mode 100644 index 4f5e19df1672..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/_azure_machine_learning_workspaces.py +++ /dev/null @@ -1,265 +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, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, FeaturesOperations, FeaturesetContainersOperations, FeaturesetVersionsOperations, FeaturestoreEntityContainersOperations, FeaturestoreEntityVersionsOperations, JobsOperations, LabelingJobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryDataContainersOperations, RegistryDataVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, 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_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 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 labeling_jobs: LabelingJobsOperations operations - :vartype labeling_jobs: - azure.mgmt.machinelearningservices.aio.operations.LabelingJobsOperations - :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 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 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 "2023-06-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_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.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.labeling_jobs = LabelingJobsOperations(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.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.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/v2023_06_01_preview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/_configuration.py deleted file mode 100644 index 7c536102af93..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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 "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/_patch.py deleted file mode 100644 index 74e48ecd07cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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/v2023_06_01_preview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/__init__.py deleted file mode 100644 index 46cd9a8ab550..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/__init__.py +++ /dev/null @@ -1,103 +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_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 ._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 ._labeling_jobs_operations import LabelingJobsOperations -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 ._operations import Operations -from ._workspaces_operations import WorkspacesOperations -from ._workspace_connections_operations import WorkspaceConnectionsOperations -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', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'FeaturesetContainersOperations', - 'FeaturesOperations', - 'FeaturesetVersionsOperations', - 'FeaturestoreEntityContainersOperations', - 'FeaturestoreEntityVersionsOperations', - 'JobsOperations', - 'LabelingJobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', - 'Operations', - 'WorkspacesOperations', - 'WorkspaceConnectionsOperations', - 'ManagedNetworkSettingsRuleOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'ManagedNetworkProvisionsOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_batch_deployments_operations.py deleted file mode 100644 index 992ddf8ea311..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_batch_endpoints_operations.py deleted file mode 100644 index 1251e0f5e5e7..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_code_containers_operations.py deleted file mode 100644 index 748396964f63..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_code_versions_operations.py deleted file mode 100644 index 104f82cc325d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_code_versions_operations.py +++ /dev/null @@ -1,453 +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_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 -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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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 - - - @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', "2023-06-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/v2023_06_01_preview/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_component_containers_operations.py deleted file mode 100644 index 6d005a89e599..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_component_versions_operations.py deleted file mode 100644 index 941d4b5fcaa2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_component_versions_operations.py +++ /dev/null @@ -1,376 +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_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, - stage: Optional[str] = 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 - :param stage: Component 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 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', "2023-06-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, - 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, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - 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("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', "2023-06-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', "2023-06-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', "2023-06-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_compute_operations.py deleted file mode 100644 index 04583e288bb0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_compute_operations.py +++ /dev/null @@ -1,1209 +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_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_custom_services_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: - """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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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 - - - 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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_data_containers_operations.py deleted file mode 100644 index d1ba46b1d195..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_data_versions_operations.py deleted file mode 100644 index 692a54b29713..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_data_versions_operations.py +++ /dev/null @@ -1,385 +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_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, - stage: Optional[str] = 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 - :param stage: data 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 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', "2023-06-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, - 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, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - 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("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', "2023-06-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', "2023-06-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', "2023-06-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_datastores_operations.py deleted file mode 100644 index d3f2fcf1aef8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_datastores_operations.py +++ /dev/null @@ -1,438 +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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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, - **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', {})) - - api_version = kwargs.pop('api_version', "2023-06-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, - name=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('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/v2023_06_01_preview/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_environment_containers_operations.py deleted file mode 100644 index 879bd838b489..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_environment_versions_operations.py deleted file mode 100644 index ac0a16029ed5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_environment_versions_operations.py +++ /dev/null @@ -1,377 +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_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, - stage: Optional[str] = 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 - :param stage: Stage for including/excluding (for example) archived entities. Takes priority - over listViewType. - :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 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', "2023-06-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, - 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, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - 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("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', "2023-06-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', "2023-06-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', "2023-06-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_features_operations.py deleted file mode 100644 index 1f0878f788ee..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_features_operations.py +++ /dev/null @@ -1,236 +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._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, - **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 - :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', "2023-06-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, - 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, - 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', "2023-06-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/v2023_06_01_preview/aio/operations/_featureset_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_featureset_containers_operations.py deleted file mode 100644 index 89c35dad8d39..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_featureset_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_featureset_versions_operations.py deleted file mode 100644 index cc21ac7d6473..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_featureset_versions_operations.py +++ /dev/null @@ -1,789 +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_materialization_jobs_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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.FeaturesetJob"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FeaturesetJob"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-06-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('FeaturesetJob', 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.FeaturesetJob"]: - """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 FeaturesetJob or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetJob] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-06-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.FeaturesetJob"] - lro_delay = kwargs.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('FeaturesetJob', 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 - - @distributed_trace - def list_materialization_jobs( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - skip: Optional[str] = None, - filters: Optional[str] = None, - feature_window_start: Optional[str] = None, - feature_window_end: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.FeaturesetJobArmPaginatedResult"]: - """List materialization Jobs. - - List materialization Jobs. - - :param resource_group_name: The name of the resource group. The name is 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 skip: Continuation token for pagination. - :type skip: str - :param filters: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type filters: str - :param feature_window_start: Start time of the feature window to filter materialization jobs. - :type feature_window_start: str - :param feature_window_end: End time of the feature window to filter materialization jobs. - :type feature_window_end: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetJobArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetJobArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetJobArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_materialization_jobs_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, - skip=skip, - filters=filters, - feature_window_start=feature_window_start, - feature_window_end=feature_window_end, - template_url=self.list_materialization_jobs.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_materialization_jobs_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, - skip=skip, - filters=filters, - feature_window_start=feature_window_start, - feature_window_end=feature_window_end, - 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("FeaturesetJobArmPaginatedResult", 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_materialization_jobs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/listMaterializationJobs"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_featurestore_entity_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_featurestore_entity_containers_operations.py deleted file mode 100644 index d90c78dd666f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_featurestore_entity_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_featurestore_entity_versions_operations.py deleted file mode 100644 index cd5eaeb47603..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_jobs_operations.py deleted file mode 100644 index 6ad56289a464..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,619 +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, build_update_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, - asset_name: Optional[str] = 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 asset_name: Asset name the job's named output is registered with. - :type asset_name: str - :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 - """ - api_version = kwargs.pop('api_version', "2023-06-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, - asset_name=asset_name, - 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, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - asset_name=asset_name, - 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( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=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', "2023-06-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', "2023-06-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', "2023-06-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 update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.PartialJobBasePartialResource", - **kwargs: Any - ) -> "_models.JobBase": - """Updates a Job. - - Updates 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 to apply during the operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialJobBasePartialResource - :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', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialJobBasePartialResource') - - request = build_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.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('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.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. - - 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.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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_labeling_jobs_operations.py deleted file mode 100644 index 301ded2e995d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_labeling_jobs_operations.py +++ /dev/null @@ -1,739 +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._labeling_jobs_operations import build_create_or_update_request_initial, build_delete_request, build_export_labels_request_initial, build_get_request, build_list_request, build_pause_request, build_resume_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class LabelingJobsOperations: - """LabelingJobsOperations 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, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncIterable["_models.LabelingJobResourceArmPaginatedResult"]: - """Lists labeling jobs in the workspace. - - Lists labeling 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 top: Number of labeling jobs to return. - :type top: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LabelingJobResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 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, - top=top, - 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, - top=top, - 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("LabelingJobResourceArmPaginatedResult", 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}/labelingJobs"} # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - """Delete a labeling job. - - Delete a labeling 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 LabelingJob. - :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', {})) - - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - - - request = build_delete_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.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}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - id: str, - include_job_instructions: Optional[bool] = False, - include_label_categories: Optional[bool] = False, - **kwargs: Any - ) -> "_models.LabelingJob": - """Gets a labeling job by name/id. - - Gets a labeling 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 LabelingJob. - :type id: str - :param include_job_instructions: Boolean value to indicate whether to include JobInstructions - in response. - :type include_job_instructions: bool - :param include_label_categories: Boolean value to indicate Whether to include LabelCategories - in response. - :type include_label_categories: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LabelingJob, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJob - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-06-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, - include_job_instructions=include_job_instructions, - include_label_categories=include_label_categories, - 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('LabelingJob', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.LabelingJob", - **kwargs: Any - ) -> "_models.LabelingJob": - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'LabelingJob') - - request = build_create_or_update_request_initial( - 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_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('LabelingJob', 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('LabelingJob', 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}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.LabelingJob", - **kwargs: Any - ) -> AsyncLROPoller["_models.LabelingJob"]: - """Creates or updates a labeling job (asynchronous). - - Creates or updates a labeling 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 LabelingJob. - :type id: str - :param body: LabelingJob definition object. - :type body: ~azure.mgmt.machinelearningservices.models.LabelingJob - :keyword callable cls: A custom type or function that will be passed the direct response - :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 LabelingJob or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-06-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.LabelingJob"] - lro_delay = kwargs.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, - id=id, - 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('LabelingJob', 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}/labelingJobs/{id}"} # type: ignore - - async def _export_labels_initial( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.ExportSummary", - **kwargs: Any - ) -> Optional["_models.ExportSummary"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExportSummary"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ExportSummary') - - request = build_export_labels_request_initial( - 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._export_labels_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('ExportSummary', 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 - - _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - - @distributed_trace_async - async def begin_export_labels( - self, - resource_group_name: str, - workspace_name: str, - id: str, - body: "_models.ExportSummary", - **kwargs: Any - ) -> AsyncLROPoller["_models.ExportSummary"]: - """Export labels from a labeling job (asynchronous). - - Export labels from a labeling 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 LabelingJob. - :type id: str - :param body: The export summary. - :type body: ~azure.mgmt.machinelearningservices.models.ExportSummary - :keyword callable cls: A custom type or function that will be passed the direct response - :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 ExportSummary or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-06-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.ExportSummary"] - lro_delay = kwargs.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._export_labels_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - 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('ExportSummary', 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_export_labels.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - @distributed_trace_async - async def pause( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> None: - """Pause a labeling job. - - Pause a labeling 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 LabelingJob. - :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', {})) - - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - - - request = build_pause_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.pause.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, 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, {}) - - pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - - - async def _resume_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', "2023-06-01-preview") # type: str - - - request = build_resume_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._resume_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) - - _resume_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore - - - @distributed_trace_async - async def begin_resume( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - id: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Resume a labeling job (asynchronous). - - Resume a labeling 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 LabelingJob. - :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', "2023-06-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._resume_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_resume.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_managed_network_provisions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_managed_network_provisions_operations.py deleted file mode 100644 index 7c72fc0de532..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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: Name of Azure Machine Learning workspace. - :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', "2023-06-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/v2023_06_01_preview/aio/operations/_managed_network_settings_rule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_managed_network_settings_rule_operations.py deleted file mode 100644 index 7ee222e579cb..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_managed_network_settings_rule_operations.py +++ /dev/null @@ -1,457 +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: 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 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', "2023-06-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', "2023-06-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')) - - - 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: Name of Azure Machine Learning workspace. - :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', "2023-06-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, **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: Name of Azure Machine Learning workspace. - :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', "2023-06-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', "2023-06-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: Name of Azure Machine Learning workspace. - :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', "2023-06-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/v2023_06_01_preview/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_model_containers_operations.py deleted file mode 100644 index c5edc972fa3c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_model_versions_operations.py deleted file mode 100644 index 7692dc6ab0c6..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_model_versions_operations.py +++ /dev/null @@ -1,556 +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_package_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, - stage: Optional[str] = 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 - :param stage: Model 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 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', "2023-06-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, - 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, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - 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("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', "2023-06-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', "2023-06-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', "2023-06-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 _package_initial( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.PackageRequest", - **kwargs: Any - ) -> Optional["_models.PackageResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PackageRequest') - - request = build_package_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._package_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('PackageResponse', 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 - - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore - - - @distributed_trace_async - async def begin_package( - self, - resource_group_name: str, - workspace_name: str, - name: str, - version: str, - body: "_models.PackageRequest", - **kwargs: Any - ) -> AsyncLROPoller["_models.PackageResponse"]: - """Model Version Package operation. - - Model Version Package 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 name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Package operation request body. - :type body: ~azure.mgmt.machinelearningservices.models.PackageRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :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 PackageResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-06-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.PackageResponse"] - lro_delay = kwargs.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._package_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('PackageResponse', 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_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_online_deployments_operations.py deleted file mode 100644 index 914c2ceb4e92..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_online_endpoints_operations.py deleted file mode 100644 index 62a0df1d2177..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_operations.py deleted file mode 100644 index 2229c95879ee..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_operations.py +++ /dev/null @@ -1,119 +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.AmlOperationListResult"]: - """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 AmlOperationListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlOperationListResult"] - error_map = { - 401: ClientAuthenticationError, 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("AmlOperationListResult", 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/v2023_06_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index a82bb1905c66..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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: 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 - """ - api_version = kwargs.pop('api_version', "2023-06-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: Name of Azure Machine Learning workspace. - :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', "2023-06-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: Name of Azure Machine Learning workspace. - :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', "2023-06-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: Name of Azure Machine Learning workspace. - :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', "2023-06-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/v2023_06_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_private_link_resources_operations.py deleted file mode 100644 index 0e83a068f5db..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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: 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 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', "2023-06-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/v2023_06_01_preview/aio/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_quotas_operations.py deleted file mode 100644 index 645689b38f53..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registries_operations.py deleted file mode 100644 index 23c73e5ba7e3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_code_containers_operations.py deleted file mode 100644 index 402ecf51158e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_code_versions_operations.py deleted file mode 100644 index fcd70dc83114..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_component_containers_operations.py deleted file mode 100644 index 9f67c0850c2a..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_component_versions_operations.py deleted file mode 100644 index 6ebdfc071448..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_component_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_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, - stage: 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 - :param stage: Component 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 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', "2023-06-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, - 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, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - 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("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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_data_containers_operations.py deleted file mode 100644 index fd4fdf7feec1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_data_versions_operations.py deleted file mode 100644 index df96d558c3ac..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_environment_containers_operations.py deleted file mode 100644 index b1fa9c19705b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_environment_versions_operations.py deleted file mode 100644 index 29d408c85033..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_environment_versions_operations.py +++ /dev/null @@ -1,505 +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, - stage: Optional[str] = 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 - :param stage: Stage for including/excluding (for example) archived entities. Takes priority - over listViewType. - :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 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', "2023-06-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, - 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, - 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, - 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("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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_model_containers_operations.py deleted file mode 100644 index c73c6f6cad93..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_model_versions_operations.py deleted file mode 100644 index 7cb5bd534ce5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_model_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 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, build_package_request_initial -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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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 - - async def _package_initial( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.PackageRequest", - **kwargs: Any - ) -> Optional["_models.PackageResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PackageRequest') - - request = build_package_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._package_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('PackageResponse', 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 - - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package"} # type: ignore - - - @distributed_trace_async - async def begin_package( - self, - resource_group_name: str, - registry_name: str, - model_name: str, - version: str, - body: "_models.PackageRequest", - **kwargs: Any - ) -> AsyncLROPoller["_models.PackageResponse"]: - """Model Version Package operation. - - Model Version Package operation. - - :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 - :param body: Package operation request body. - :type body: ~azure.mgmt.machinelearningservices.models.PackageRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :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 PackageResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-06-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.PackageResponse"] - lro_delay = kwargs.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._package_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('PackageResponse', 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_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package"} # 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', "2023-06-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/v2023_06_01_preview/aio/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_schedules_operations.py deleted file mode 100644 index ed9b3f139917..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/aio/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_usages_operations.py deleted file mode 100644 index 69caf580f16c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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/v2023_06_01_preview/aio/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_virtual_machine_sizes_operations.py deleted file mode 100644 index 1b9e4f6fed96..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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/v2023_06_01_preview/aio/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_workspace_connections_operations.py deleted file mode 100644 index 0cdd76e702df..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_workspace_connections_operations.py +++ /dev/null @@ -1,484 +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._workspace_connections_operations import build_create_request, build_delete_request, build_get_request, build_list_request, build_list_secrets_request, 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, - **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: 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 - """ - api_version = kwargs.pop('api_version', "2023-06-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, - 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, - 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: 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', {})) - - api_version = kwargs.pop('api_version', "2023-06-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: 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', {})) - - api_version = kwargs.pop('api_version', "2023-06-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: Name of Azure Machine Learning workspace. - :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', "2023-06-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: Name of Azure Machine Learning workspace. - :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', "2023-06-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: 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', {})) - - api_version = kwargs.pop('api_version', "2023-06-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_workspace_features_operations.py deleted file mode 100644 index 6d28ba70da34..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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/v2023_06_01_preview/aio/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_workspaces_operations.py deleted file mode 100644 index 5e4f7f7cc103..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_workspaces_operations.py +++ /dev/null @@ -1,1341 +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, - skip: Optional[str] = None, - kind: 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 skip: Continuation token for pagination. - :type skip: str - :param kind: Kind of workspace. - :type kind: 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', "2023-06-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, - skip=skip, - kind=kind, - 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, - skip=skip, - kind=kind, - 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, - skip: Optional[str] = None, - kind: 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 skip: Continuation token for pagination. - :type skip: str - :param kind: Kind of workspace. - :type kind: 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', "2023-06-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, - skip=skip, - kind=kind, - 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, - skip=skip, - kind=kind, - 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', "2023-06-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) - - 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( # 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: Name of Azure Machine Learning workspace. - :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', "2023-06-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, **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: 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', {})) - - api_version = kwargs.pop('api_version', "2023-06-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', "2023-06-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: Name of Azure Machine Learning workspace. - :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', "2023-06-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', "2023-06-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: Name of Azure Machine Learning workspace. - :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', "2023-06-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', "2023-06-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: Name of Azure Machine Learning workspace. - :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', "2023-06-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: 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', {})) - - api_version = kwargs.pop('api_version', "2023-06-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: 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', {})) - - api_version = kwargs.pop('api_version', "2023-06-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: 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', {})) - - api_version = kwargs.pop('api_version', "2023-06-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: 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', {})) - - api_version = kwargs.pop('api_version', "2023-06-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: 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', {})) - - api_version = kwargs.pop('api_version', "2023-06-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', "2023-06-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: 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 - """ - api_version = kwargs.pop('api_version', "2023-06-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', "2023-06-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: 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 - """ - api_version = kwargs.pop('api_version', "2023-06-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/v2023_06_01_preview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/__init__.py deleted file mode 100644 index cbe062f46adb..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/__init__.py +++ /dev/null @@ -1,2094 +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 AKSSchema - from ._models_py3 import AKSSchemaProperties - from ._models_py3 import AccessKeyAuthTypeWorkspaceConnectionProperties - 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 AmlOperation - from ._models_py3 import AmlOperationListResult - from ._models_py3 import AmlToken - from ._models_py3 import AmlTokenComputeIdentity - from ._models_py3 import AmlUserFeature - 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 AutoDeleteSetting - 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 AutologgerSettings - from ._models_py3 import AzMonMonitoringAlertNotificationSettings - 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 AzureMLBatchInferencingServer - from ._models_py3 import AzureMLOnlineInferencingServer - from ._models_py3 import BanditPolicy - from ._models_py3 import BaseEnvironmentId - from ._models_py3 import BaseEnvironmentSource - 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 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 ClassificationModelPerformanceMetricThreshold - from ._models_py3 import ClassificationTrainingSettings - from ._models_py3 import ClusterUpdateParameters - from ._models_py3 import CocoExportSummary - 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 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 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 CosmosDbSettings - from ._models_py3 import CreateMonitorAction - from ._models_py3 import Cron - from ._models_py3 import CronTrigger - from ._models_py3 import CsvExportSummary - from ._models_py3 import CustomForecastHorizon - from ._models_py3 import CustomInferencingServer - 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 DataImport - from ._models_py3 import DataImportSource - 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 DataVersionBase - from ._models_py3 import DataVersionBaseProperties - from ._models_py3 import DataVersionBaseResourceArmPaginatedResult - from ._models_py3 import DatabaseSource - 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 DatasetExportSummary - 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 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 EarlyTerminationPolicy - from ._models_py3 import EmailMonitoringAlertNotificationSettings - 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 EndpointDeploymentPropertiesBase - from ._models_py3 import EndpointPropertiesBase - 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 ExportSummary - 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 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 FeaturesetJob - from ._models_py3 import FeaturesetJobArmPaginatedResult - from ._models_py3 import FeaturesetSpecification - from ._models_py3 import FeaturesetVersion - from ._models_py3 import FeaturesetVersionBackfillRequest - 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 FileSystemSource - 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 GenerationSafetyQualityMetricThreshold - from ._models_py3 import GenerationSafetyQualityMonitoringSignal - from ._models_py3 import GenerationTokenStatisticsMetricThreshold - from ._models_py3 import GenerationTokenStatisticsSignal - from ._models_py3 import GridSamplingAlgorithm - from ._models_py3 import HDInsight - from ._models_py3 import HDInsightProperties - from ._models_py3 import HDInsightSchema - from ._models_py3 import HdfsDatastore - 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 ImportDataAction - from ._models_py3 import IndexColumn - from ._models_py3 import InferenceContainerProperties - from ._models_py3 import InferencingServer - from ._models_py3 import InstanceTypeSchema - from ._models_py3 import InstanceTypeSchemaResources - from ._models_py3 import IntellectualProperty - 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 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 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 LabelCategory - from ._models_py3 import LabelClass - from ._models_py3 import LabelingDataConfiguration - from ._models_py3 import LabelingJob - from ._models_py3 import LabelingJobImageProperties - from ._models_py3 import LabelingJobInstructions - from ._models_py3 import LabelingJobMediaProperties - from ._models_py3 import LabelingJobProperties - from ._models_py3 import LabelingJobResourceArmPaginatedResult - from ._models_py3 import LabelingJobTextProperties - 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 MLAssistConfiguration - from ._models_py3 import MLAssistConfigurationDisabled - from ._models_py3 import MLAssistConfigurationEnabled - 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 ManagedNetworkProvisionOptions - from ._models_py3 import ManagedNetworkProvisionStatus - from ._models_py3 import ManagedNetworkSettings - from ._models_py3 import ManagedOnlineDeployment - from ._models_py3 import ManagedServiceIdentity - from ._models_py3 import MaterializationComputeResource - from ._models_py3 import MaterializationSettings - from ._models_py3 import MedianStoppingPolicy - from ._models_py3 import ModelConfiguration - from ._models_py3 import ModelContainer - from ._models_py3 import ModelContainerProperties - from ._models_py3 import ModelContainerResourceArmPaginatedResult - from ._models_py3 import ModelPackageInput - from ._models_py3 import ModelPerformanceMetricThresholdBase - from ._models_py3 import ModelPerformanceSignal - 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 MonitorServerlessSparkCompute - from ._models_py3 import MonitoringAlertNotificationSettingsBase - from ._models_py3 import MonitoringDataSegment - 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 MonitoringWorkspaceConnection - from ._models_py3 import Mpi - from ._models_py3 import NCrossValidations - from ._models_py3 import NlpFixedParameters - from ._models_py3 import NlpParameterSubspace - from ._models_py3 import NlpSweepSettings - 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 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 OnlineInferenceConfiguration - from ._models_py3 import OnlineRequestSettings - from ._models_py3 import OnlineScaleSettings - from ._models_py3 import OperationDisplay - 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 PackageInputPathBase - from ._models_py3 import PackageInputPathId - from ._models_py3 import PackageInputPathUrl - from ._models_py3 import PackageInputPathVersion - from ._models_py3 import PackageRequest - from ._models_py3 import PackageResponse - from ._models_py3 import PaginatedComputeResourcesList - from ._models_py3 import PartialBatchDeployment - from ._models_py3 import PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - from ._models_py3 import PartialJobBase - from ._models_py3 import PartialJobBasePartialResource - from ._models_py3 import PartialManagedServiceIdentity - from ._models_py3 import PartialMinimalTrackedResource - from ._models_py3 import PartialMinimalTrackedResourceWithIdentity - from ._models_py3 import PartialMinimalTrackedResourceWithSku - from ._models_py3 import PartialNotificationSetting - 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 ProgressMetrics - from ._models_py3 import PyTorch - from ._models_py3 import QueueSettings - from ._models_py3 import QuotaBaseProperties - from ._models_py3 import QuotaUpdateParameters - from ._models_py3 import RandomSamplingAlgorithm - from ._models_py3 import Ray - from ._models_py3 import Recurrence - from ._models_py3 import RecurrenceSchedule - from ._models_py3 import RecurrenceTrigger - from ._models_py3 import RegenerateEndpointKeysRequest - 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 RegressionModelPerformanceMetricThreshold - from ._models_py3 import RegressionTrainingSettings - from ._models_py3 import RequestLogging - 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 Route - from ._models_py3 import SASAuthTypeWorkspaceConnectionProperties - 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 SecretConfiguration - 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 SslConfiguration - from ._models_py3 import StackEnsembleSettings - from ._models_py3 import StaticInputData - from ._models_py3 import StatusMessage - 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 TableFixedParameters - from ._models_py3 import TableParameterSubspace - from ._models_py3 import TableSweepSettings - 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 TrailingInputData - from ._models_py3 import TrainingSettings - from ._models_py3 import TrialComponent - from ._models_py3 import TriggerBase - from ._models_py3 import TritonInferencingServer - 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 WorkspaceConnectionApiKey - from ._models_py3 import WorkspaceConnectionManagedIdentity - 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 AKS # type: ignore - from ._models import AKSSchema # type: ignore - from ._models import AKSSchemaProperties # type: ignore - from ._models import AccessKeyAuthTypeWorkspaceConnectionProperties # 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 AmlOperation # type: ignore - from ._models import AmlOperationListResult # type: ignore - from ._models import AmlToken # type: ignore - from ._models import AmlTokenComputeIdentity # type: ignore - from ._models import AmlUserFeature # 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 AutoDeleteSetting # 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 AutologgerSettings # type: ignore - from ._models import AzMonMonitoringAlertNotificationSettings # 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 AzureMLBatchInferencingServer # type: ignore - from ._models import AzureMLOnlineInferencingServer # type: ignore - from ._models import BanditPolicy # type: ignore - from ._models import BaseEnvironmentId # type: ignore - from ._models import BaseEnvironmentSource # 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 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 ClassificationModelPerformanceMetricThreshold # type: ignore - from ._models import ClassificationTrainingSettings # type: ignore - from ._models import ClusterUpdateParameters # type: ignore - from ._models import CocoExportSummary # 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 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 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 CosmosDbSettings # type: ignore - from ._models import CreateMonitorAction # type: ignore - from ._models import Cron # type: ignore - from ._models import CronTrigger # type: ignore - from ._models import CsvExportSummary # type: ignore - from ._models import CustomForecastHorizon # type: ignore - from ._models import CustomInferencingServer # 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 DataImport # type: ignore - from ._models import DataImportSource # 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 DataVersionBase # type: ignore - from ._models import DataVersionBaseProperties # type: ignore - from ._models import DataVersionBaseResourceArmPaginatedResult # type: ignore - from ._models import DatabaseSource # 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 DatasetExportSummary # 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 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 EarlyTerminationPolicy # type: ignore - from ._models import EmailMonitoringAlertNotificationSettings # 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 EndpointDeploymentPropertiesBase # type: ignore - from ._models import EndpointPropertiesBase # 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 ExportSummary # 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 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 FeaturesetJob # type: ignore - from ._models import FeaturesetJobArmPaginatedResult # type: ignore - from ._models import FeaturesetSpecification # type: ignore - from ._models import FeaturesetVersion # type: ignore - from ._models import FeaturesetVersionBackfillRequest # 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 FileSystemSource # 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 GenerationSafetyQualityMetricThreshold # type: ignore - from ._models import GenerationSafetyQualityMonitoringSignal # type: ignore - from ._models import GenerationTokenStatisticsMetricThreshold # type: ignore - from ._models import GenerationTokenStatisticsSignal # 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 HdfsDatastore # 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 ImportDataAction # type: ignore - from ._models import IndexColumn # type: ignore - from ._models import InferenceContainerProperties # type: ignore - from ._models import InferencingServer # type: ignore - from ._models import InstanceTypeSchema # type: ignore - from ._models import InstanceTypeSchemaResources # type: ignore - from ._models import IntellectualProperty # 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 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 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 LabelCategory # type: ignore - from ._models import LabelClass # type: ignore - from ._models import LabelingDataConfiguration # type: ignore - from ._models import LabelingJob # type: ignore - from ._models import LabelingJobImageProperties # type: ignore - from ._models import LabelingJobInstructions # type: ignore - from ._models import LabelingJobMediaProperties # type: ignore - from ._models import LabelingJobProperties # type: ignore - from ._models import LabelingJobResourceArmPaginatedResult # type: ignore - from ._models import LabelingJobTextProperties # 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 MLAssistConfiguration # type: ignore - from ._models import MLAssistConfigurationDisabled # type: ignore - from ._models import MLAssistConfigurationEnabled # 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 ManagedNetworkProvisionOptions # type: ignore - from ._models import ManagedNetworkProvisionStatus # type: ignore - from ._models import ManagedNetworkSettings # type: ignore - from ._models import ManagedOnlineDeployment # type: ignore - from ._models import ManagedServiceIdentity # type: ignore - from ._models import MaterializationComputeResource # type: ignore - from ._models import MaterializationSettings # type: ignore - from ._models import MedianStoppingPolicy # type: ignore - from ._models import ModelConfiguration # type: ignore - from ._models import ModelContainer # type: ignore - from ._models import ModelContainerProperties # type: ignore - from ._models import ModelContainerResourceArmPaginatedResult # type: ignore - from ._models import ModelPackageInput # type: ignore - from ._models import ModelPerformanceMetricThresholdBase # type: ignore - from ._models import ModelPerformanceSignal # 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 MonitorServerlessSparkCompute # type: ignore - from ._models import MonitoringAlertNotificationSettingsBase # type: ignore - from ._models import MonitoringDataSegment # 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 MonitoringWorkspaceConnection # type: ignore - from ._models import Mpi # type: ignore - from ._models import NCrossValidations # type: ignore - from ._models import NlpFixedParameters # type: ignore - from ._models import NlpParameterSubspace # type: ignore - from ._models import NlpSweepSettings # 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 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 OnlineInferenceConfiguration # type: ignore - from ._models import OnlineRequestSettings # type: ignore - from ._models import OnlineScaleSettings # type: ignore - from ._models import OperationDisplay # 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 PackageInputPathBase # type: ignore - from ._models import PackageInputPathId # type: ignore - from ._models import PackageInputPathUrl # type: ignore - from ._models import PackageInputPathVersion # type: ignore - from ._models import PackageRequest # type: ignore - from ._models import PackageResponse # type: ignore - from ._models import PaginatedComputeResourcesList # type: ignore - from ._models import PartialBatchDeployment # type: ignore - from ._models import PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties # type: ignore - from ._models import PartialJobBase # type: ignore - from ._models import PartialJobBasePartialResource # 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 PartialNotificationSetting # 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 ProgressMetrics # 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 RandomSamplingAlgorithm # type: ignore - from ._models import Ray # 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 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 RegressionModelPerformanceMetricThreshold # type: ignore - from ._models import RegressionTrainingSettings # type: ignore - from ._models import RequestLogging # 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 Route # type: ignore - from ._models import SASAuthTypeWorkspaceConnectionProperties # 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 SecretConfiguration # 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 SslConfiguration # type: ignore - from ._models import StackEnsembleSettings # type: ignore - from ._models import StaticInputData # type: ignore - from ._models import StatusMessage # 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 TableFixedParameters # type: ignore - from ._models import TableParameterSubspace # type: ignore - from ._models import TableSweepSettings # 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 TrailingInputData # type: ignore - from ._models import TrainingSettings # type: ignore - from ._models import TrialComponent # type: ignore - from ._models import TriggerBase # type: ignore - from ._models import TritonInferencingServer # 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 WorkspaceConnectionApiKey # type: ignore - from ._models import WorkspaceConnectionManagedIdentity # 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 ( - AllocationState, - ApplicationSharingPolicy, - AssetProvisioningState, - AutoDeleteCondition, - AutoRebuildSetting, - Autosave, - BaseEnvironmentSourceType, - BatchDeploymentConfigurationType, - BatchLoggingLevel, - BatchOutputAction, - BillingCurrency, - BlockedTransformers, - Caching, - CategoricalDataDriftMetric, - CategoricalDataQualityMetric, - CategoricalPredictionDriftMetric, - ClassificationModelPerformanceMetric, - ClassificationModels, - ClassificationMultilabelPrimaryMetrics, - ClassificationPrimaryMetrics, - ClusterPurpose, - ComputeInstanceAuthorizationType, - ComputeInstanceState, - ComputePowerAction, - ComputeType, - ConnectionAuthType, - ConnectionCategory, - ContainerType, - CreatedByType, - CredentialsType, - DataCollectionMode, - DataImportSourceType, - DataType, - DatastoreType, - DeploymentProvisioningState, - DiagnoseResultLevel, - DistributionType, - EarlyTerminationPolicyType, - EgressPublicNetworkAccessType, - EmailNotificationEnableType, - EncryptionStatus, - EndpointAuthMode, - EndpointComputeType, - EndpointProvisioningState, - EndpointServiceConnectionStatus, - EnvironmentType, - EnvironmentVariableType, - ExportFormatType, - FeatureAttributionMetric, - FeatureDataType, - FeatureLags, - FeaturestoreJobType, - FeaturizationMode, - ForecastHorizonMode, - ForecastingModels, - ForecastingPrimaryMetrics, - GenerationSafetyQualityMetric, - GenerationTokenStatisticsMetric, - Goal, - IdentityConfigurationType, - ImageAnnotationType, - ImageType, - IncrementalDataRefresh, - InferencingServerType, - InputDeliveryMode, - InputPathType, - InstanceSegmentationPrimaryMetrics, - IsolationMode, - JobInputType, - JobLimitsType, - JobOutputType, - JobProvisioningState, - JobStatus, - JobTier, - JobType, - KeyType, - LearningRateScheduler, - ListViewType, - LoadBalancerType, - LogTrainingMetrics, - LogValidationLoss, - LogVerbosity, - MLAssistConfigurationType, - MLFlowAutologgerState, - ManagedNetworkStatus, - ManagedServiceIdentityType, - MaterializationStoreType, - MediaType, - MlflowAutologger, - ModelSize, - ModelTaskType, - MonitorComputeIdentityType, - MonitorComputeType, - MonitoringAlertNotificationType, - MonitoringFeatureDataType, - MonitoringFeatureFilterType, - MonitoringInputDataType, - MonitoringModelType, - MonitoringNotificationMode, - MonitoringSignalType, - MountAction, - MountState, - MultiSelect, - NCrossValidationsMode, - Network, - NlpLearningRateScheduler, - NodeState, - NodesValueType, - NumericalDataDriftMetric, - NumericalDataQualityMetric, - NumericalPredictionDriftMetric, - ObjectDetectionPrimaryMetrics, - OneLakeArtifactType, - OperatingSystemType, - OperationName, - OperationStatus, - OperationTrigger, - OrderString, - OsType, - OutputDeliveryMode, - PackageBuildState, - PackageInputDeliveryMode, - PackageInputType, - PendingUploadCredentialType, - PendingUploadType, - PrivateEndpointConnectionProvisioningState, - ProtectionLevel, - Protocol, - ProvisioningState, - ProvisioningStatus, - PublicNetworkAccessType, - QuotaUnit, - RandomSamplingAlgorithmRule, - RecurrenceFrequency, - ReferenceType, - RegressionModelPerformanceMetric, - RegressionModels, - RegressionPrimaryMetrics, - RemoteLoginPortPublicAccess, - RollingRateType, - RuleAction, - RuleCategory, - RuleStatus, - RuleType, - SamplingAlgorithmType, - ScaleType, - ScheduleActionType, - ScheduleListViewType, - ScheduleProvisioningState, - ScheduleProvisioningStatus, - ScheduleStatus, - SeasonalityMode, - SecretsType, - ServiceDataAccessAuthIdentity, - ShortSeriesHandlingConfiguration, - SkuScaleType, - SkuTier, - SourceType, - SparkJobEntryType, - SshPublicAccess, - SslConfigStatus, - StackMetaLearnerType, - Status, - StatusMessageLevel, - StochasticOptimizer, - StorageAccountType, - TargetAggregationFunction, - TargetLagsMode, - TargetRollingWindowSizeMode, - TaskType, - TextAnnotationType, - TrainingMode, - TriggerType, - UnderlyingResourceAction, - UnitOfMeasure, - UsageUnit, - UseStl, - VMPriceOSType, - VMTier, - ValidationMetricType, - VmPriority, - VolumeDefinitionType, - WebhookType, - WeekDay, -) - -__all__ = [ - 'AKS', - 'AKSSchema', - 'AKSSchemaProperties', - 'AccessKeyAuthTypeWorkspaceConnectionProperties', - 'AccountKeyDatastoreCredentials', - 'AccountKeyDatastoreSecrets', - 'AcrDetails', - 'AksComputeSecrets', - 'AksComputeSecretsProperties', - 'AksNetworkingConfiguration', - 'AllFeatures', - 'AllNodes', - 'AmlCompute', - 'AmlComputeNodeInformation', - 'AmlComputeNodesInformation', - 'AmlComputeProperties', - 'AmlComputeSchema', - 'AmlOperation', - 'AmlOperationListResult', - 'AmlToken', - 'AmlTokenComputeIdentity', - 'AmlUserFeature', - 'ApiKeyAuthWorkspaceConnectionProperties', - 'ArmResourceId', - 'AssetBase', - 'AssetContainer', - 'AssetJobInput', - 'AssetJobOutput', - 'AssetReferenceBase', - 'AssignedUser', - 'AutoDeleteSetting', - 'AutoForecastHorizon', - 'AutoMLJob', - 'AutoMLVertical', - 'AutoNCrossValidations', - 'AutoPauseProperties', - 'AutoScaleProperties', - 'AutoSeasonality', - 'AutoTargetLags', - 'AutoTargetRollingWindowSize', - 'AutologgerSettings', - 'AzMonMonitoringAlertNotificationSettings', - 'AzureBlobDatastore', - 'AzureDataLakeGen1Datastore', - 'AzureDataLakeGen2Datastore', - 'AzureDatastore', - 'AzureDevOpsWebhook', - 'AzureFileDatastore', - 'AzureMLBatchInferencingServer', - 'AzureMLOnlineInferencingServer', - 'BanditPolicy', - 'BaseEnvironmentId', - 'BaseEnvironmentSource', - 'BatchDeployment', - 'BatchDeploymentConfiguration', - 'BatchDeploymentProperties', - 'BatchDeploymentTrackedResourceArmPaginatedResult', - 'BatchEndpoint', - 'BatchEndpointDefaults', - 'BatchEndpointProperties', - 'BatchEndpointTrackedResourceArmPaginatedResult', - 'BatchPipelineComponentDeploymentConfiguration', - 'BatchRetrySettings', - 'BayesianSamplingAlgorithm', - 'BindOptions', - 'BlobReferenceForConsumptionDto', - 'BuildContext', - 'CategoricalDataDriftMetricThreshold', - 'CategoricalDataQualityMetricThreshold', - 'CategoricalPredictionDriftMetricThreshold', - 'CertificateDatastoreCredentials', - 'CertificateDatastoreSecrets', - 'Classification', - 'ClassificationModelPerformanceMetricThreshold', - 'ClassificationTrainingSettings', - 'ClusterUpdateParameters', - 'CocoExportSummary', - 'CodeConfiguration', - 'CodeContainer', - 'CodeContainerProperties', - 'CodeContainerResourceArmPaginatedResult', - 'CodeVersion', - 'CodeVersionProperties', - 'CodeVersionResourceArmPaginatedResult', - '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', - 'ComputeResource', - 'ComputeResourceSchema', - 'ComputeRuntimeDto', - 'ComputeSchedules', - 'ComputeSecrets', - 'ComputeStartStopSchedule', - 'ContainerResourceRequirements', - 'ContainerResourceSettings', - 'CosmosDbSettings', - 'CreateMonitorAction', - 'Cron', - 'CronTrigger', - 'CsvExportSummary', - 'CustomForecastHorizon', - 'CustomInferencingServer', - 'CustomKeys', - 'CustomKeysWorkspaceConnectionProperties', - 'CustomMetricThreshold', - 'CustomModelJobInput', - 'CustomModelJobOutput', - 'CustomMonitoringSignal', - 'CustomNCrossValidations', - 'CustomSeasonality', - 'CustomService', - 'CustomTargetLags', - 'CustomTargetRollingWindowSize', - 'DataCollector', - 'DataContainer', - 'DataContainerProperties', - 'DataContainerResourceArmPaginatedResult', - 'DataDriftMetricThresholdBase', - 'DataDriftMonitoringSignal', - 'DataFactory', - 'DataImport', - 'DataImportSource', - 'DataLakeAnalytics', - 'DataLakeAnalyticsSchema', - 'DataLakeAnalyticsSchemaProperties', - 'DataPathAssetReference', - 'DataQualityMetricThresholdBase', - 'DataQualityMonitoringSignal', - 'DataVersionBase', - 'DataVersionBaseProperties', - 'DataVersionBaseResourceArmPaginatedResult', - 'DatabaseSource', - 'Databricks', - 'DatabricksComputeSecrets', - 'DatabricksComputeSecretsProperties', - 'DatabricksProperties', - 'DatabricksSchema', - 'DatasetExportSummary', - 'Datastore', - 'DatastoreCredentials', - 'DatastoreProperties', - 'DatastoreResourceArmPaginatedResult', - 'DatastoreSecrets', - 'DefaultScaleSettings', - 'DeploymentLogs', - 'DeploymentLogsRequest', - 'DeploymentResourceConfiguration', - 'DiagnoseRequestProperties', - 'DiagnoseResponseResult', - 'DiagnoseResponseResultValue', - 'DiagnoseResult', - 'DiagnoseWorkspaceParameters', - 'DistributionConfiguration', - 'Docker', - 'EarlyTerminationPolicy', - 'EmailMonitoringAlertNotificationSettings', - 'EncryptionKeyVaultUpdateProperties', - 'EncryptionProperty', - 'EncryptionUpdateProperties', - 'Endpoint', - 'EndpointAuthKeys', - 'EndpointAuthToken', - 'EndpointDeploymentPropertiesBase', - 'EndpointPropertiesBase', - 'EndpointScheduleAction', - 'EnvironmentContainer', - 'EnvironmentContainerProperties', - 'EnvironmentContainerResourceArmPaginatedResult', - 'EnvironmentVariable', - 'EnvironmentVersion', - 'EnvironmentVersionProperties', - 'EnvironmentVersionResourceArmPaginatedResult', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'EstimatedVMPrice', - 'EstimatedVMPrices', - 'ExportSummary', - 'ExternalFQDNResponse', - 'FQDNEndpoint', - 'FQDNEndpointDetail', - 'FQDNEndpoints', - 'FQDNEndpointsPropertyBag', - 'Feature', - 'FeatureAttributionDriftMonitoringSignal', - 'FeatureAttributionMetricThreshold', - 'FeatureProperties', - 'FeatureResourceArmPaginatedResult', - 'FeatureStoreSettings', - 'FeatureSubset', - 'FeatureWindow', - 'FeaturesetContainer', - 'FeaturesetContainerProperties', - 'FeaturesetContainerResourceArmPaginatedResult', - 'FeaturesetJob', - 'FeaturesetJobArmPaginatedResult', - 'FeaturesetSpecification', - 'FeaturesetVersion', - 'FeaturesetVersionBackfillRequest', - 'FeaturesetVersionProperties', - 'FeaturesetVersionResourceArmPaginatedResult', - 'FeaturestoreEntityContainer', - 'FeaturestoreEntityContainerProperties', - 'FeaturestoreEntityContainerResourceArmPaginatedResult', - 'FeaturestoreEntityVersion', - 'FeaturestoreEntityVersionProperties', - 'FeaturestoreEntityVersionResourceArmPaginatedResult', - 'FeaturizationSettings', - 'FileSystemSource', - 'FixedInputData', - 'FlavorData', - 'ForecastHorizon', - 'Forecasting', - 'ForecastingSettings', - 'ForecastingTrainingSettings', - 'FqdnOutboundRule', - 'GenerationSafetyQualityMetricThreshold', - 'GenerationSafetyQualityMonitoringSignal', - 'GenerationTokenStatisticsMetricThreshold', - 'GenerationTokenStatisticsSignal', - 'GridSamplingAlgorithm', - 'HDInsight', - 'HDInsightProperties', - 'HDInsightSchema', - 'HdfsDatastore', - 'IdAssetReference', - 'IdentityConfiguration', - 'IdentityForCmk', - 'IdleShutdownSetting', - 'Image', - 'ImageClassification', - 'ImageClassificationBase', - 'ImageClassificationMultilabel', - 'ImageInstanceSegmentation', - 'ImageLimitSettings', - 'ImageMetadata', - 'ImageModelDistributionSettings', - 'ImageModelDistributionSettingsClassification', - 'ImageModelDistributionSettingsObjectDetection', - 'ImageModelSettings', - 'ImageModelSettingsClassification', - 'ImageModelSettingsObjectDetection', - 'ImageObjectDetection', - 'ImageObjectDetectionBase', - 'ImageSweepSettings', - 'ImageVertical', - 'ImportDataAction', - 'IndexColumn', - 'InferenceContainerProperties', - 'InferencingServer', - 'InstanceTypeSchema', - 'InstanceTypeSchemaResources', - 'IntellectualProperty', - 'JobBase', - 'JobBaseProperties', - 'JobBaseResourceArmPaginatedResult', - 'JobInput', - 'JobLimits', - 'JobOutput', - 'JobResourceConfiguration', - 'JobScheduleAction', - 'JobService', - 'KerberosCredentials', - 'KerberosKeytabCredentials', - 'KerberosKeytabSecrets', - 'KerberosPasswordCredentials', - 'KerberosPasswordSecrets', - 'KeyVaultProperties', - 'Kubernetes', - 'KubernetesOnlineDeployment', - 'KubernetesProperties', - 'KubernetesSchema', - 'LabelCategory', - 'LabelClass', - 'LabelingDataConfiguration', - 'LabelingJob', - 'LabelingJobImageProperties', - 'LabelingJobInstructions', - 'LabelingJobMediaProperties', - 'LabelingJobProperties', - 'LabelingJobResourceArmPaginatedResult', - 'LabelingJobTextProperties', - 'LakeHouseArtifact', - 'ListAmlUserFeatureResult', - 'ListNotebookKeysResult', - 'ListStorageAccountKeysResult', - 'ListUsagesResult', - 'ListWorkspaceKeysResult', - 'ListWorkspaceQuotas', - 'LiteralJobInput', - 'MLAssistConfiguration', - 'MLAssistConfigurationDisabled', - 'MLAssistConfigurationEnabled', - 'MLFlowModelJobInput', - 'MLFlowModelJobOutput', - 'MLTableData', - 'MLTableJobInput', - 'MLTableJobOutput', - 'ManagedComputeIdentity', - 'ManagedIdentity', - 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', - 'ManagedNetworkProvisionOptions', - 'ManagedNetworkProvisionStatus', - 'ManagedNetworkSettings', - 'ManagedOnlineDeployment', - 'ManagedServiceIdentity', - 'MaterializationComputeResource', - 'MaterializationSettings', - 'MedianStoppingPolicy', - 'ModelConfiguration', - 'ModelContainer', - 'ModelContainerProperties', - 'ModelContainerResourceArmPaginatedResult', - 'ModelPackageInput', - 'ModelPerformanceMetricThresholdBase', - 'ModelPerformanceSignal', - 'ModelVersion', - 'ModelVersionProperties', - 'ModelVersionResourceArmPaginatedResult', - 'MonitorComputeConfigurationBase', - 'MonitorComputeIdentityBase', - 'MonitorDefinition', - 'MonitorServerlessSparkCompute', - 'MonitoringAlertNotificationSettingsBase', - 'MonitoringDataSegment', - 'MonitoringFeatureFilterBase', - 'MonitoringInputDataBase', - 'MonitoringSignalBase', - 'MonitoringTarget', - 'MonitoringThreshold', - 'MonitoringWorkspaceConnection', - 'Mpi', - 'NCrossValidations', - 'NlpFixedParameters', - 'NlpParameterSubspace', - 'NlpSweepSettings', - 'NlpVertical', - 'NlpVerticalFeaturizationSettings', - 'NlpVerticalLimitSettings', - 'NodeStateCounts', - 'Nodes', - 'NoneAuthTypeWorkspaceConnectionProperties', - 'NoneDatastoreCredentials', - 'NotebookAccessTokenResult', - 'NotebookPreparationError', - 'NotebookResourceInfo', - 'NotificationSetting', - 'NumericalDataDriftMetricThreshold', - 'NumericalDataQualityMetricThreshold', - 'NumericalPredictionDriftMetricThreshold', - 'Objective', - 'OneLakeArtifact', - 'OneLakeDatastore', - 'OnlineDeployment', - 'OnlineDeploymentProperties', - 'OnlineDeploymentTrackedResourceArmPaginatedResult', - 'OnlineEndpoint', - 'OnlineEndpointProperties', - 'OnlineEndpointTrackedResourceArmPaginatedResult', - 'OnlineInferenceConfiguration', - 'OnlineRequestSettings', - 'OnlineScaleSettings', - 'OperationDisplay', - 'OutboundRule', - 'OutboundRuleBasicResource', - 'OutboundRuleListResult', - 'OutputPathAssetReference', - 'PATAuthTypeWorkspaceConnectionProperties', - 'PackageInputPathBase', - 'PackageInputPathId', - 'PackageInputPathUrl', - 'PackageInputPathVersion', - 'PackageRequest', - 'PackageResponse', - 'PaginatedComputeResourcesList', - 'PartialBatchDeployment', - 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties', - 'PartialJobBase', - 'PartialJobBasePartialResource', - 'PartialManagedServiceIdentity', - 'PartialMinimalTrackedResource', - 'PartialMinimalTrackedResourceWithIdentity', - 'PartialMinimalTrackedResourceWithSku', - 'PartialNotificationSetting', - 'PartialRegistryPartialTrackedResource', - 'PartialSku', - 'Password', - 'PendingUploadCredentialDto', - 'PendingUploadRequestDto', - 'PendingUploadResponseDto', - 'PersonalComputeInstanceSettings', - 'PipelineJob', - 'PredictionDriftMetricThresholdBase', - 'PredictionDriftMonitoringSignal', - 'PrivateEndpoint', - 'PrivateEndpointConnection', - 'PrivateEndpointConnectionListResult', - 'PrivateEndpointDestination', - 'PrivateEndpointOutboundRule', - 'PrivateEndpointResource', - 'PrivateLinkResource', - 'PrivateLinkResourceListResult', - 'PrivateLinkServiceConnectionState', - 'ProbeSettings', - 'ProgressMetrics', - 'PyTorch', - 'QueueSettings', - 'QuotaBaseProperties', - 'QuotaUpdateParameters', - 'RandomSamplingAlgorithm', - 'Ray', - 'Recurrence', - 'RecurrenceSchedule', - 'RecurrenceTrigger', - 'RegenerateEndpointKeysRequest', - 'Registry', - 'RegistryListCredentialsResult', - 'RegistryPartialManagedServiceIdentity', - 'RegistryPrivateEndpointConnection', - 'RegistryPrivateLinkServiceConnectionState', - 'RegistryRegionArmDetails', - 'RegistryTrackedResourceArmPaginatedResult', - 'Regression', - 'RegressionModelPerformanceMetricThreshold', - 'RegressionTrainingSettings', - 'RequestLogging', - 'Resource', - 'ResourceBase', - 'ResourceConfiguration', - 'ResourceId', - 'ResourceName', - 'ResourceQuota', - 'Route', - 'SASAuthTypeWorkspaceConnectionProperties', - 'SASCredentialDto', - 'SamplingAlgorithm', - 'SasDatastoreCredentials', - 'SasDatastoreSecrets', - 'ScaleSettings', - 'ScaleSettingsInformation', - 'Schedule', - 'ScheduleActionBase', - 'ScheduleBase', - 'ScheduleProperties', - 'ScheduleResourceArmPaginatedResult', - 'ScriptReference', - 'ScriptsToExecute', - 'Seasonality', - 'SecretConfiguration', - 'ServiceManagedResourcesSettings', - 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', - 'ServicePrincipalDatastoreCredentials', - 'ServicePrincipalDatastoreSecrets', - 'ServiceTagDestination', - 'ServiceTagOutboundRule', - 'SetupScripts', - 'SharedPrivateLinkResource', - 'Sku', - 'SkuCapacity', - 'SkuResource', - 'SkuResourceArmPaginatedResult', - 'SkuSetting', - 'SparkJob', - 'SparkJobEntry', - 'SparkJobPythonEntry', - 'SparkJobScalaEntry', - 'SparkResourceConfiguration', - 'SslConfiguration', - 'StackEnsembleSettings', - 'StaticInputData', - 'StatusMessage', - 'StorageAccountDetails', - 'SweepJob', - 'SweepJobLimits', - 'SynapseSpark', - 'SynapseSparkProperties', - 'SystemCreatedAcrAccount', - 'SystemCreatedStorageAccount', - 'SystemData', - 'SystemService', - 'TableFixedParameters', - 'TableParameterSubspace', - 'TableSweepSettings', - 'TableVertical', - 'TableVerticalFeaturizationSettings', - 'TableVerticalLimitSettings', - 'TargetLags', - 'TargetRollingWindowSize', - 'TargetUtilizationScaleSettings', - 'TensorFlow', - 'TextClassification', - 'TextClassificationMultilabel', - 'TextNer', - 'TmpfsOptions', - 'TopNFeaturesByAttribution', - 'TrackedResource', - 'TrailingInputData', - 'TrainingSettings', - 'TrialComponent', - 'TriggerBase', - 'TritonInferencingServer', - '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', - 'WorkspaceConnectionApiKey', - 'WorkspaceConnectionManagedIdentity', - 'WorkspaceConnectionPersonalAccessToken', - 'WorkspaceConnectionPropertiesV2', - 'WorkspaceConnectionPropertiesV2BasicResource', - 'WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult', - 'WorkspaceConnectionServicePrincipal', - 'WorkspaceConnectionSharedAccessSignature', - 'WorkspaceConnectionUpdateParameter', - 'WorkspaceConnectionUsernamePassword', - 'WorkspaceHubConfig', - 'WorkspaceListResult', - 'WorkspacePrivateEndpointResource', - 'WorkspaceUpdateParameters', - 'AllocationState', - 'ApplicationSharingPolicy', - 'AssetProvisioningState', - 'AutoDeleteCondition', - 'AutoRebuildSetting', - 'Autosave', - 'BaseEnvironmentSourceType', - 'BatchDeploymentConfigurationType', - 'BatchLoggingLevel', - 'BatchOutputAction', - 'BillingCurrency', - 'BlockedTransformers', - 'Caching', - 'CategoricalDataDriftMetric', - 'CategoricalDataQualityMetric', - 'CategoricalPredictionDriftMetric', - 'ClassificationModelPerformanceMetric', - 'ClassificationModels', - 'ClassificationMultilabelPrimaryMetrics', - 'ClassificationPrimaryMetrics', - 'ClusterPurpose', - 'ComputeInstanceAuthorizationType', - 'ComputeInstanceState', - 'ComputePowerAction', - 'ComputeType', - 'ConnectionAuthType', - 'ConnectionCategory', - 'ContainerType', - 'CreatedByType', - 'CredentialsType', - 'DataCollectionMode', - 'DataImportSourceType', - 'DataType', - 'DatastoreType', - 'DeploymentProvisioningState', - 'DiagnoseResultLevel', - 'DistributionType', - 'EarlyTerminationPolicyType', - 'EgressPublicNetworkAccessType', - 'EmailNotificationEnableType', - 'EncryptionStatus', - 'EndpointAuthMode', - 'EndpointComputeType', - 'EndpointProvisioningState', - 'EndpointServiceConnectionStatus', - 'EnvironmentType', - 'EnvironmentVariableType', - 'ExportFormatType', - 'FeatureAttributionMetric', - 'FeatureDataType', - 'FeatureLags', - 'FeaturestoreJobType', - 'FeaturizationMode', - 'ForecastHorizonMode', - 'ForecastingModels', - 'ForecastingPrimaryMetrics', - 'GenerationSafetyQualityMetric', - 'GenerationTokenStatisticsMetric', - 'Goal', - 'IdentityConfigurationType', - 'ImageAnnotationType', - 'ImageType', - 'IncrementalDataRefresh', - 'InferencingServerType', - 'InputDeliveryMode', - 'InputPathType', - 'InstanceSegmentationPrimaryMetrics', - 'IsolationMode', - 'JobInputType', - 'JobLimitsType', - 'JobOutputType', - 'JobProvisioningState', - 'JobStatus', - 'JobTier', - 'JobType', - 'KeyType', - 'LearningRateScheduler', - 'ListViewType', - 'LoadBalancerType', - 'LogTrainingMetrics', - 'LogValidationLoss', - 'LogVerbosity', - 'MLAssistConfigurationType', - 'MLFlowAutologgerState', - 'ManagedNetworkStatus', - 'ManagedServiceIdentityType', - 'MaterializationStoreType', - 'MediaType', - 'MlflowAutologger', - 'ModelSize', - 'ModelTaskType', - 'MonitorComputeIdentityType', - 'MonitorComputeType', - 'MonitoringAlertNotificationType', - 'MonitoringFeatureDataType', - 'MonitoringFeatureFilterType', - 'MonitoringInputDataType', - 'MonitoringModelType', - 'MonitoringNotificationMode', - 'MonitoringSignalType', - 'MountAction', - 'MountState', - 'MultiSelect', - 'NCrossValidationsMode', - 'Network', - 'NlpLearningRateScheduler', - 'NodeState', - 'NodesValueType', - 'NumericalDataDriftMetric', - 'NumericalDataQualityMetric', - 'NumericalPredictionDriftMetric', - 'ObjectDetectionPrimaryMetrics', - 'OneLakeArtifactType', - 'OperatingSystemType', - 'OperationName', - 'OperationStatus', - 'OperationTrigger', - 'OrderString', - 'OsType', - 'OutputDeliveryMode', - 'PackageBuildState', - 'PackageInputDeliveryMode', - 'PackageInputType', - 'PendingUploadCredentialType', - 'PendingUploadType', - 'PrivateEndpointConnectionProvisioningState', - 'ProtectionLevel', - 'Protocol', - 'ProvisioningState', - 'ProvisioningStatus', - 'PublicNetworkAccessType', - 'QuotaUnit', - 'RandomSamplingAlgorithmRule', - 'RecurrenceFrequency', - 'ReferenceType', - 'RegressionModelPerformanceMetric', - 'RegressionModels', - 'RegressionPrimaryMetrics', - 'RemoteLoginPortPublicAccess', - 'RollingRateType', - 'RuleAction', - 'RuleCategory', - 'RuleStatus', - 'RuleType', - 'SamplingAlgorithmType', - 'ScaleType', - 'ScheduleActionType', - 'ScheduleListViewType', - 'ScheduleProvisioningState', - 'ScheduleProvisioningStatus', - 'ScheduleStatus', - 'SeasonalityMode', - 'SecretsType', - 'ServiceDataAccessAuthIdentity', - 'ShortSeriesHandlingConfiguration', - 'SkuScaleType', - 'SkuTier', - 'SourceType', - 'SparkJobEntryType', - 'SshPublicAccess', - 'SslConfigStatus', - 'StackMetaLearnerType', - 'Status', - 'StatusMessageLevel', - 'StochasticOptimizer', - 'StorageAccountType', - 'TargetAggregationFunction', - 'TargetLagsMode', - 'TargetRollingWindowSizeMode', - 'TaskType', - 'TextAnnotationType', - 'TrainingMode', - 'TriggerType', - 'UnderlyingResourceAction', - 'UnitOfMeasure', - 'UsageUnit', - 'UseStl', - 'VMPriceOSType', - 'VMTier', - 'ValidationMetricType', - 'VmPriority', - 'VolumeDefinitionType', - 'WebhookType', - 'WeekDay', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/_azure_machine_learning_workspaces_enums.py deleted file mode 100644 index 4b93108750a0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/_azure_machine_learning_workspaces_enums.py +++ /dev/null @@ -1,1940 +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 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 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 AutoDeleteCondition(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - CREATED_GREATER_THAN = "CreatedGreaterThan" - LAST_ACCESSED_GREATER_THAN = "LastAccessedGreaterThan" - -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 BaseEnvironmentSourceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Base environment type. - """ - - ENVIRONMENT_ASSET = "EnvironmentAsset" - -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 ClassificationModelPerformanceMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Calculates the accuracy of the model predictions. - ACCURACY = "Accuracy" - #: Calculates the precision of the model predictions. - PRECISION = "Precision" - #: Calculates the recall of the model predictions. - RECALL = "Recall" - -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" - 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 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 ConnectionAuthType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Authentication type of the connection target - """ - - PAT = "PAT" - MANAGED_IDENTITY = "ManagedIdentity" - USERNAME_PASSWORD = "UsernamePassword" - NONE = "None" - SAS = "SAS" - SERVICE_PRINCIPAL = "ServicePrincipal" - ACCESS_KEY = "AccessKey" - API_KEY = "ApiKey" - CUSTOM_KEYS = "CustomKeys" - -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" - COGNITIVE_SEARCH = "CognitiveSearch" - COGNITIVE_SERVICE = "CognitiveService" - CUSTOM_KEYS = "CustomKeys" - -class ContainerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of container to retrieve logs from. - """ - - #: The container used to download models and score script. - STORAGE_INITIALIZER = "StorageInitializer" - #: The container used to serve user's request. - INFERENCE_SERVER = "InferenceServer" - #: The container used to collect payload and custom logging when mdc is enabled. - MODEL_DATA_COLLECTOR = "ModelDataCollector" - -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" - KERBEROS_KEYTAB = "KerberosKeytab" - KERBEROS_PASSWORD = "KerberosPassword" - -class DataCollectionMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class DataImportSourceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of data. - """ - - DATABASE = "database" - FILE_SYSTEM = "file_system" - -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" - HDFS = "Hdfs" - 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 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" - RAY = "Ray" - -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 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 ExportFormatType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The format of exported labels. - """ - - DATASET = "Dataset" - COCO = "Coco" - CSV = "CSV" - -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 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 FeaturestoreJobType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - RECURRENT_MATERIALIZATION = "RecurrentMaterialization" - BACKFILL_MATERIALIZATION = "BackfillMaterialization" - -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 is a deep neural network model - #: capable of modeling correlations over long time periods. - 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 GenerationSafetyQualityMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Generation safety quality metric enum. - """ - - ACCEPTABLE_GROUNDEDNESS_SCORE_PER_INSTANCE = "AcceptableGroundednessScorePerInstance" - AGGREGATED_GROUNDEDNESS_PASS_RATE = "AggregatedGroundednessPassRate" - ACCEPTABLE_COHERENCE_SCORE_PER_INSTANCE = "AcceptableCoherenceScorePerInstance" - AGGREGATED_COHERENCE_PASS_RATE = "AggregatedCoherencePassRate" - ACCEPTABLE_FLUENCY_SCORE_PER_INSTANCE = "AcceptableFluencyScorePerInstance" - AGGREGATED_FLUENCY_PASS_RATE = "AggregatedFluencyPassRate" - ACCEPTABLE_SIMILARITY_SCORE_PER_INSTANCE = "AcceptableSimilarityScorePerInstance" - AGGREGATED_SIMILARITY_PASS_RATE = "AggregatedSimilarityPassRate" - ACCEPTABLE_RELEVANCE_SCORE_PER_INSTANCE = "AcceptableRelevanceScorePerInstance" - AGGREGATED_RELEVANCE_PASS_RATE = "AggregatedRelevancePassRate" - -class GenerationTokenStatisticsMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Generation token statistics metric enum. - """ - - TOTAL_TOKEN_COUNT = "TotalTokenCount" - TOTAL_TOKEN_COUNT_PER_GROUP = "TotalTokenCountPerGroup" - -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 ImageAnnotationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Annotation type of image data. - """ - - CLASSIFICATION = "Classification" - BOUNDING_BOX = "BoundingBox" - INSTANCE_SEGMENTATION = "InstanceSegmentation" - -class ImageType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of the image. Possible values are: docker - For docker images. azureml - For AzureML - images - """ - - DOCKER = "docker" - AZUREML = "azureml" - -class IncrementalDataRefresh(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Whether IncrementalDataRefresh is enabled - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class InferencingServerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Inferencing server type for various targets. - """ - - AZURE_ML_ONLINE = "AzureMLOnline" - AZURE_ML_BATCH = "AzureMLBatch" - TRITON = "Triton" - CUSTOM = "Custom" - -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 InputPathType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Input path type for package inputs. - """ - - URL = "Url" - PATH_ID = "PathId" - PATH_VERSION = "PathVersion" - -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 JobProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the job provisioning state. - """ - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - IN_PROGRESS = "InProgress" - -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" - #: The job is in a scheduled state. Job is not in any active state. - SCHEDULED = "Scheduled" - -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" - LABELING = "Labeling" - 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 LogTrainingMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Enable compute and log training metrics. - ENABLE = "Enable" - #: Disable compute and log training metrics. - DISABLE = "Disable" - -class LogValidationLoss(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Enable compute and log validation metrics. - ENABLE = "Enable" - #: Disable compute and log validation metrics. - DISABLE = "Disable" - -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 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 MaterializationStoreType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - NONE = "None" - ONLINE = "Online" - OFFLINE = "Offline" - ONLINE_AND_OFFLINE = "OnlineAndOffline" - -class MediaType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Media type of data asset. - """ - - IMAGE = "Image" - TEXT = "Text" - -class MLAssistConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class MlflowAutologger(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Indicates whether mlflow autologger is enabled for notebooks. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class MLFlowAutologgerState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the state of mlflow autologger. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -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" - QUESTION_ANSWERING = "QuestionAnswering" - -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 MonitoringAlertNotificationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Settings for Azure Monitor based alerting. - AZURE_MONITOR = "AzureMonitor" - #: Settings for AML email notifications. - EMAIL = "Email" - -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 trailing relatively to the monitor's current run. - TRAILING = "Trailing" - #: An input data with tabular format which doesn't require preprocessing. - FIXED = "Fixed" - -class MonitoringModelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: A model trained for classification tasks. - CLASSIFICATION = "Classification" - #: A model trained for regressions tasks. - REGRESSION = "Regression" - -class MonitoringNotificationMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: Disabled notifications will not produce emails/metrics leveraged for alerting. - DISABLED = "Disabled" - #: Enabled notification will produce emails/metrics leveraged for alerting. - ENABLED = "Enabled" - -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" - #: Tracks model performance based on ground truth data. - MODEL_PERFORMANCE = "ModelPerformance" - #: Tracks the safety and quality of generated content. - GENERATION_SAFETY_QUALITY = "GenerationSafetyQuality" - #: Tracks the token usage of generative endpoints. - GENERATION_TOKEN_STATISTICS = "GenerationTokenStatistics" - -class MountAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mount Action. - """ - - MOUNT = "Mount" - UNMOUNT = "Unmount" - -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 MultiSelect(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Whether multiSelect is enabled - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -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 NlpLearningRateScheduler(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum of learning rate schedulers that aligns with those supported by HF - """ - - #: No learning rate schedule. - NONE = "None" - #: Linear warmup and decay. - LINEAR = "Linear" - #: Linear warmup then cosine decay. - COSINE = "Cosine" - #: Linear warmup, cosine decay, then restart to initial LR. - COSINE_WITH_RESTARTS = "CosineWithRestarts" - #: Increase linearly then polynomially decay. - POLYNOMIAL = "Polynomial" - #: Constant learning rate. - CONSTANT = "Constant" - #: Linear warmup followed by constant value. - CONSTANT_WITH_WARMUP = "ConstantWithWarmup" - -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" - CUSTOM = "Custom" - -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" - 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" - 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 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 PackageBuildState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Package build state returned in package response. - """ - - NOT_STARTED = "NotStarted" - RUNNING = "Running" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - -class PackageInputDeliveryMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mounting type of the model or the inputs - """ - - COPY = "Copy" - DOWNLOAD = "Download" - -class PackageInputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of the inputs. - """ - - URI_FILE = "UriFile" - URI_FOLDER = "UriFolder" - -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 ProtectionLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Protection level associated with the Intellectual Property. - """ - - #: All means Intellectual Property is fully protected. - ALL = "All" - #: None means it is not an Intellectual Property. - NONE = "None" - -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 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 RegressionModelPerformanceMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - #: The Mean Absolute Error (MAE) metric. - MEAN_ABSOLUTE_ERROR = "MeanAbsoluteError" - #: The Root Mean Squared Error (RMSE) metric. - ROOT_MEAN_SQUARED_ERROR = "RootMeanSquaredError" - #: The Mean Squared Error (MSE) metric. - MEAN_SQUARED_ERROR = "MeanSquaredError" - -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" - -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" - IMPORT_DATA = "ImportData" - 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" - KERBEROS_PASSWORD = "KerberosPassword" - KERBEROS_KEYTAB = "KerberosKeytab" - -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 StatusMessageLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - - ERROR = "Error" - INFORMATION = "Information" - WARNING = "Warning" - -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 TextAnnotationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Annotation type of text data. - """ - - CLASSIFICATION = "Classification" - NAMED_ENTITY_RECOGNITION = "NamedEntityRecognition" - -class TrainingMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Training mode dictates whether to use distributed training or not - """ - - #: Auto mode. - AUTO = "Auto" - #: Distributed training mode. - DISTRIBUTED = "Distributed" - #: Non distributed training mode. - NON_DISTRIBUTED = "NonDistributed" - -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/v2023_06_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/_models.py deleted file mode 100644 index d2ae30a5af84..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/_models.py +++ /dev/null @@ -1,30663 +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: AccessKeyAuthTypeWorkspaceConnectionProperties, ApiKeyAuthWorkspaceConnectionProperties, CustomKeysWorkspaceConnectionProperties, 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", "AccessKey", "ApiKey", "CustomKeys". - :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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - _subtype_map = { - 'auth_type': {'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', 'ApiKey': 'ApiKeyAuthWorkspaceConnectionProperties', 'CustomKeys': 'CustomKeysWorkspaceConnectionProperties', '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", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - """ - super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) - self.auth_type = None # type: Optional[str] - self.category = kwargs.get('category', None) - self.expiry_time = kwargs.get('expiry_time', None) - self.metadata = kwargs.get('metadata', None) - self.target = kwargs.get('target', None) - - -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """AccessKeyAuthTypeWorkspaceConnectionProperties. - - 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", "AccessKey", "ApiKey", "CustomKeys". - :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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - '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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :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 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 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", "Custom". - :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", "Custom". - :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 AmlOperation(msrest.serialization.Model): - """Azure Machine Learning team account REST API operation. - - :ivar display: Gets or sets display name of operation. - :vartype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - :ivar is_data_action: Indicates whether the operation applies to data-plane. - :vartype is_data_action: bool - :ivar name: Gets or sets operation name: {provider}/{resource}/{operation}. - :vartype name: str - :ivar origin: The intended executor of the operation: user/system. - :vartype origin: str - """ - - _attribute_map = { - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'origin': {'key': 'origin', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword display: Gets or sets display name of operation. - :paramtype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - :keyword is_data_action: Indicates whether the operation applies to data-plane. - :paramtype is_data_action: bool - :keyword name: Gets or sets operation name: {provider}/{resource}/{operation}. - :paramtype name: str - :keyword origin: The intended executor of the operation: user/system. - :paramtype origin: str - """ - super(AmlOperation, self).__init__(**kwargs) - self.display = kwargs.get('display', None) - self.is_data_action = kwargs.get('is_data_action', None) - self.name = kwargs.get('name', None) - self.origin = kwargs.get('origin', None) - - -class AmlOperationListResult(msrest.serialization.Model): - """An array of operations supported by the resource provider. - - :ivar value: Gets or sets list of AML team account operations supported by the - AML team account resource provider. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlOperation]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: Gets or sets list of AML team account operations supported by the - AML team account resource provider. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] - """ - super(AmlOperationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', 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] Monitor compute identity type enum.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] Monitor compute identity type enum.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 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. - - 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", "AccessKey", "ApiKey", "CustomKeys". - :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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: Api key object for workspace connection credential. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - '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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - """ - super(AssetBase, self).__init__(**kwargs) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - 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 asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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 asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', 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 AutoDeleteSetting(msrest.serialization.Model): - """AutoDeleteSetting. - - :ivar condition: When to check if an asset is expired. Possible values include: - "CreatedGreaterThan", "LastAccessedGreaterThan". - :vartype condition: str or ~azure.mgmt.machinelearningservices.models.AutoDeleteCondition - :ivar value: Expiration condition value. - :vartype value: str - """ - - _attribute_map = { - 'condition': {'key': 'condition', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword condition: When to check if an asset is expired. Possible values include: - "CreatedGreaterThan", "LastAccessedGreaterThan". - :paramtype condition: str or ~azure.mgmt.machinelearningservices.models.AutoDeleteCondition - :keyword value: Expiration condition value. - :paramtype value: str - """ - super(AutoDeleteSetting, self).__init__(**kwargs) - self.condition = kwargs.get('condition', None) - self.value = kwargs.get('value', None) - - -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 AutologgerSettings(msrest.serialization.Model): - """Settings for Autologger. - - All required parameters must be populated in order to send to Azure. - - :ivar mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is enabled. - Possible values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - - _validation = { - 'mlflow_autologger': {'required': True}, - } - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is - enabled. Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - super(AutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = kwargs['mlflow_autologger'] - - -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, LabelingJobProperties, 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", "Labeling", "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 secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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}'}, - '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'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Labeling': 'LabelingJobProperties', '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 secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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.secrets_configuration = kwargs.get('secrets_configuration', 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", "Labeling", "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 secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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 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'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - '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 secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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 MonitoringAlertNotificationSettingsBase(msrest.serialization.Model): - """MonitoringAlertNotificationSettingsBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzMonMonitoringAlertNotificationSettings, EmailMonitoringAlertNotificationSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_type: Required. [Required] Specifies the type of signal to - monitor.Constant filled by server. Possible values include: "AzureMonitor", "Email". - :vartype alert_notification_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringAlertNotificationType - """ - - _validation = { - 'alert_notification_type': {'required': True}, - } - - _attribute_map = { - 'alert_notification_type': {'key': 'alertNotificationType', 'type': 'str'}, - } - - _subtype_map = { - 'alert_notification_type': {'AzureMonitor': 'AzMonMonitoringAlertNotificationSettings', 'Email': 'EmailMonitoringAlertNotificationSettings'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitoringAlertNotificationSettingsBase, self).__init__(**kwargs) - self.alert_notification_type = None # type: Optional[str] - - -class AzMonMonitoringAlertNotificationSettings(MonitoringAlertNotificationSettingsBase): - """AzMonMonitoringAlertNotificationSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_type: Required. [Required] Specifies the type of signal to - monitor.Constant filled by server. Possible values include: "AzureMonitor", "Email". - :vartype alert_notification_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringAlertNotificationType - """ - - _validation = { - 'alert_notification_type': {'required': True}, - } - - _attribute_map = { - 'alert_notification_type': {'key': 'alertNotificationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AzMonMonitoringAlertNotificationSettings, self).__init__(**kwargs) - self.alert_notification_type = 'AzureMonitor' # 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, HdfsDatastore, 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", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - } - - _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'Hdfs': 'HdfsDatastore', '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 - :keyword intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - """ - super(DatastoreProperties, self).__init__(**kwargs) - self.credentials = kwargs['credentials'] - self.datastore_type = 'DatastoreProperties' # type: str - self.intellectual_property = kwargs.get('intellectual_property', None) - 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", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - '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 intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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.intellectual_property = kwargs.get('intellectual_property', None) - 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", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - '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 intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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.intellectual_property = kwargs.get('intellectual_property', None) - 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", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - '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 intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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.intellectual_property = kwargs.get('intellectual_property', None) - 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", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - '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 intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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.intellectual_property = kwargs.get('intellectual_property', None) - self.is_default = None - - -class InferencingServer(msrest.serialization.Model): - """InferencingServer. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureMLBatchInferencingServer, AzureMLOnlineInferencingServer, CustomInferencingServer, TritonInferencingServer. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - } - - _subtype_map = { - 'server_type': {'AzureMLBatch': 'AzureMLBatchInferencingServer', 'AzureMLOnline': 'AzureMLOnlineInferencingServer', 'Custom': 'CustomInferencingServer', 'Triton': 'TritonInferencingServer'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(InferencingServer, self).__init__(**kwargs) - self.server_type = None # type: Optional[str] - - -class AzureMLBatchInferencingServer(InferencingServer): - """Azure ML batch inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML batch inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML batch inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLBatchInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLBatch' # type: str - self.code_configuration = kwargs.get('code_configuration', None) - - -class AzureMLOnlineInferencingServer(InferencingServer): - """Azure ML online inferencing configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLOnlineInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLOnline' # type: str - self.code_configuration = kwargs.get('code_configuration', 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 BaseEnvironmentSource(msrest.serialization.Model): - """BaseEnvironmentSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BaseEnvironmentId. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - } - - _subtype_map = { - 'base_environment_source_type': {'EnvironmentAsset': 'BaseEnvironmentId'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BaseEnvironmentSource, self).__init__(**kwargs) - self.base_environment_source_type = None # type: Optional[str] - - -class BaseEnvironmentId(BaseEnvironmentSource): - """Base environment type. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - :ivar resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :vartype resource_id: str - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - 'resource_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :paramtype resource_id: str - """ - super(BaseEnvironmentId, self).__init__(**kwargs) - self.base_environment_source_type = 'EnvironmentAsset' # type: str - self.resource_id = kwargs['resource_id'] - - -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 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 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 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 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 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", "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, '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", "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 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', 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 ModelPerformanceMetricThresholdBase(msrest.serialization.Model): - """ModelPerformanceMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ClassificationModelPerformanceMetricThreshold, RegressionModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :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 = { - 'model_type': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'model_type': {'Classification': 'ClassificationModelPerformanceMetricThreshold', 'Regression': 'RegressionModelPerformanceMetricThreshold'} - } - - 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(ModelPerformanceMetricThresholdBase, self).__init__(**kwargs) - self.model_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) - - -class ClassificationModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): - """ClassificationModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :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 classification model performance to calculate. Possible - values include: "Accuracy", "Precision", "Recall". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationModelPerformanceMetric - """ - - _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', '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 classification model performance to calculate. - Possible values include: "Accuracy", "Precision", "Recall". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationModelPerformanceMetric - """ - super(ClassificationModelPerformanceMetricThreshold, self).__init__(**kwargs) - self.model_type = 'Classification' # type: str - self.metric = kwargs['metric'] - - -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 - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - - _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'}, - 'training_mode': {'key': 'trainingMode', '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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - 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) - self.training_mode = kwargs.get('training_mode', 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - '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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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 ExportSummary(msrest.serialization.Model): - """ExportSummary. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CsvExportSummary, CocoExportSummary, DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - } - - _subtype_map = { - 'format': {'CSV': 'CsvExportSummary', 'Coco': 'CocoExportSummary', 'Dataset': 'DatasetExportSummary'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ExportSummary, self).__init__(**kwargs) - self.end_date_time = None - self.exported_row_count = None - self.format = None # type: Optional[str] - self.labeling_job_id = None - self.start_date_time = None - - -class CocoExportSummary(ExportSummary): - """CocoExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CocoExportSummary, self).__init__(**kwargs) - self.format = 'Coco' # type: str - self.container_name = None - self.snapshot_path = 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(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.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(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.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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 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", "Labeling", "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 secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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 autologger_settings: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :vartype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :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, Ray, 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'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'AutologgerSettings'}, - '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 secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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 autologger_settings: Distribution configuration of the job. If set, this should be one - of Mpi, Tensorflow, PyTorch, or null. - :paramtype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :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, Ray, 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.autologger_settings = kwargs.get('autologger_settings', None) - 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(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.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(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.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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 - :ivar stage: Stage in the component lifecycle. - :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}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - '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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword component_spec: Defines Component definition details. - - - .. raw:: html - - . - :paramtype component_spec: any - :keyword stage: Stage in the component lifecycle. - :paramtype stage: str - """ - super(ComponentVersionProperties, self).__init__(**kwargs) - self.component_spec = kwargs.get('component_spec', None) - self.provisioning_state = None - self.stage = kwargs.get('stage', 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 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'}, - '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 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.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", "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 - :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", "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 - :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", "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 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'}, - '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 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.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', True) - 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 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.TriggerType - :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.TriggerType - :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 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, ImportDataAction, 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", "ImportData", - "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', 'ImportData': 'ImportDataAction', '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", "ImportData", - "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 CsvExportSummary(ExportSummary): - """CsvExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CsvExportSummary, self).__init__(**kwargs) - self.format = 'CSV' # type: str - self.container_name = None - self.snapshot_path = None - - -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 CustomInferencingServer(InferencingServer): - """Custom inference server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for custom inferencing. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for custom inferencing. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(CustomInferencingServer, self).__init__(**kwargs) - self.server_type = 'Custom' # type: str - self.inference_configuration = kwargs.get('inference_configuration', None) - - -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. - - 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", "AccessKey", "ApiKey", "CustomKeys". - :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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: Custom Keys credential object. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - '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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :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 asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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 asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', 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, GenerationSafetyQualityMonitoringSignal, GenerationTokenStatisticsSignal, ModelPerformanceSignal, PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :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", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - """ - - _validation = { - 'signal_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', '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', 'GenerationSafetyQuality': 'GenerationSafetyQualityMonitoringSignal', 'GenerationTokenStatistics': 'GenerationTokenStatisticsSignal', 'ModelPerformance': 'ModelPerformanceSignal', 'PredictionDrift': 'PredictionDriftMonitoringSignal'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(MonitoringSignalBase, self).__init__(**kwargs) - self.mode = kwargs.get('mode', 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 mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :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", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar component_id: Required. [Required] ARM resource ID of the component resource 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] - :ivar workspace_connection: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype workspace_connection: - ~azure.mgmt.machinelearningservices.models.MonitoringWorkspaceConnection - """ - - _validation = { - 'signal_type': {'required': True}, - 'component_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'metric_thresholds': {'required': True}, - 'workspace_connection': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', '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]'}, - 'workspace_connection': {'key': 'workspaceConnection', 'type': 'MonitoringWorkspaceConnection'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword component_id: Required. [Required] ARM resource ID of the component resource 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] - :keyword workspace_connection: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype workspace_connection: - ~azure.mgmt.machinelearningservices.models.MonitoringWorkspaceConnection - """ - 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'] - self.workspace_connection = kwargs['workspace_connection'] - - -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] - """ - - _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]'}, - } - - 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] - """ - 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) - - -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 DataImportSource(msrest.serialization.Model): - """DataImportSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DatabaseSource, FileSystemSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - } - - _subtype_map = { - 'source_type': {'database': 'DatabaseSource', 'file_system': 'FileSystemSource'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - """ - super(DataImportSource, self).__init__(**kwargs) - self.connection = kwargs.get('connection', None) - self.source_type = None # type: Optional[str] - - -class DatabaseSource(DataImportSource): - """DatabaseSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - :ivar query: SQL Query statement for data import Database source. - :vartype query: str - :ivar stored_procedure: SQL StoredProcedure on data import Database source. - :vartype stored_procedure: str - :ivar stored_procedure_params: SQL StoredProcedure parameters. - :vartype stored_procedure_params: list[dict[str, str]] - :ivar table_name: Name of the table on data import Database source. - :vartype table_name: str - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'query': {'key': 'query', 'type': 'str'}, - 'stored_procedure': {'key': 'storedProcedure', 'type': 'str'}, - 'stored_procedure_params': {'key': 'storedProcedureParams', 'type': '[{str}]'}, - 'table_name': {'key': 'tableName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - :keyword query: SQL Query statement for data import Database source. - :paramtype query: str - :keyword stored_procedure: SQL StoredProcedure on data import Database source. - :paramtype stored_procedure: str - :keyword stored_procedure_params: SQL StoredProcedure parameters. - :paramtype stored_procedure_params: list[dict[str, str]] - :keyword table_name: Name of the table on data import Database source. - :paramtype table_name: str - """ - super(DatabaseSource, self).__init__(**kwargs) - self.source_type = 'database' # type: str - self.query = kwargs.get('query', None) - self.stored_procedure = kwargs.get('stored_procedure', None) - self.stored_procedure_params = kwargs.get('stored_procedure_params', None) - self.table_name = kwargs.get('table_name', None) - - -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(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.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 mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :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", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar data_segment: The data segment used for scoping on a subset of the data population. - :vartype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :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 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 = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - '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 mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword data_segment: The data segment used for scoping on a subset of the data population. - :paramtype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :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 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.data_segment = kwargs.get('data_segment', None) - self.feature_data_type_override = kwargs.get('feature_data_type_override', 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 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: 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}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', '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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(DataVersionBaseProperties, self).__init__(**kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str - self.data_uri = kwargs['data_uri'] - self.intellectual_property = kwargs.get('intellectual_property', None) - self.stage = kwargs.get('stage', None) - - -class DataImport(DataVersionBaseProperties): - """DataImport. - - 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - :ivar asset_name: Name of the asset for data import job to create. - :vartype asset_name: str - :ivar source: Source data of the asset to import from. - :vartype source: ~azure.mgmt.machinelearningservices.models.DataImportSource - """ - - _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}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'DataImportSource'}, - } - - 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - :keyword asset_name: Name of the asset for data import job to create. - :paramtype asset_name: str - :keyword source: Source data of the asset to import from. - :paramtype source: ~azure.mgmt.machinelearningservices.models.DataImportSource - """ - super(DataImport, self).__init__(**kwargs) - self.data_type = 'uri_folder' # type: str - self.asset_name = kwargs.get('asset_name', None) - self.source = kwargs.get('source', 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 mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :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", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :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 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 = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - '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 mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :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 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.features = kwargs.get('features', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class DatasetExportSummary(ExportSummary): - """DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar labeled_asset_name: The unique name of the labeled data asset. - :vartype labeled_asset_name: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'labeled_asset_name': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'labeled_asset_name': {'key': 'labeledAssetName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatasetExportSummary, self).__init__(**kwargs) - self.format = 'Dataset' # type: str - self.labeled_asset_name = None - - -class Datastore(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.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(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.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 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", "ModelDataCollector". - :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", "ModelDataCollector". - :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 locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - '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 locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :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.locations = kwargs.get('locations', None) - self.max_instance_count = kwargs.get('max_instance_count', 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 locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - '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 locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(DeploymentResourceConfiguration, self).__init__(**kwargs) - - -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 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}'}, - '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 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.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, Ray, 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", - "Ray". - :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', 'Ray': 'Ray', '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 EmailMonitoringAlertNotificationSettings(MonitoringAlertNotificationSettingsBase): - """EmailMonitoringAlertNotificationSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_type: Required. [Required] Specifies the type of signal to - monitor.Constant filled by server. Possible values include: "AzureMonitor", "Email". - :vartype alert_notification_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringAlertNotificationType - :ivar email_notification_setting: Configuration for notification. - :vartype email_notification_setting: - ~azure.mgmt.machinelearningservices.models.NotificationSetting - """ - - _validation = { - 'alert_notification_type': {'required': True}, - } - - _attribute_map = { - 'alert_notification_type': {'key': 'alertNotificationType', 'type': 'str'}, - 'email_notification_setting': {'key': 'emailNotificationSetting', 'type': 'NotificationSetting'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword email_notification_setting: Configuration for notification. - :paramtype email_notification_setting: - ~azure.mgmt.machinelearningservices.models.NotificationSetting - """ - super(EmailMonitoringAlertNotificationSettings, self).__init__(**kwargs) - self.alert_notification_type = 'Email' # type: str - self.email_notification_setting = kwargs.get('email_notification_setting', 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 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", "ImportData", - "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(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.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(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.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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - '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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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.intellectual_property = kwargs.get('intellectual_property', 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(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.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 mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :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", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :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}, - 'metric_threshold': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'FeatureAttributionMetricThreshold'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :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.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 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(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.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 FeaturesetJob(msrest.serialization.Model): - """Dto object representing the feature set job. - - :ivar created_date: Specifies the created date. - :vartype created_date: ~datetime.datetime - :ivar display_name: Specifies the display name. - :vartype display_name: str - :ivar duration: Specifies the duration. - :vartype duration: ~datetime.timedelta - :ivar experiment_id: Specifies the experiment id. - :vartype experiment_id: str - :ivar feature_window: Specifies the backfill feature window to be materialized. - :vartype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :ivar job_id: Specifies the job id. - :vartype job_id: str - :ivar status: Specifies the job status. 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 tags: A set of tags. Specifies the tags if any. - :vartype tags: dict[str, str] - :ivar type: Specifies the feature store job type. Possible values include: - "RecurrentMaterialization", "BackfillMaterialization". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.FeaturestoreJobType - """ - - _attribute_map = { - 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'duration': {'key': 'duration', 'type': 'duration'}, - 'experiment_id': {'key': 'experimentId', 'type': 'str'}, - 'feature_window': {'key': 'featureWindow', 'type': 'FeatureWindow'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword created_date: Specifies the created date. - :paramtype created_date: ~datetime.datetime - :keyword display_name: Specifies the display name. - :paramtype display_name: str - :keyword duration: Specifies the duration. - :paramtype duration: ~datetime.timedelta - :keyword experiment_id: Specifies the experiment id. - :paramtype experiment_id: str - :keyword feature_window: Specifies the backfill feature window to be materialized. - :paramtype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :keyword job_id: Specifies the job id. - :paramtype job_id: str - :keyword status: Specifies the job status. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :keyword tags: A set of tags. Specifies the tags if any. - :paramtype tags: dict[str, str] - :keyword type: Specifies the feature store job type. Possible values include: - "RecurrentMaterialization", "BackfillMaterialization". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.FeaturestoreJobType - """ - super(FeaturesetJob, self).__init__(**kwargs) - self.created_date = kwargs.get('created_date', None) - self.display_name = kwargs.get('display_name', None) - self.duration = kwargs.get('duration', None) - self.experiment_id = kwargs.get('experiment_id', None) - self.feature_window = kwargs.get('feature_window', None) - self.job_id = kwargs.get('job_id', None) - self.status = kwargs.get('status', None) - self.tags = kwargs.get('tags', None) - self.type = kwargs.get('type', None) - - -class FeaturesetJobArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetJob entities. - - :ivar next_link: The link to the next page of FeaturesetJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetJob] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetJob]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetJob] - """ - super(FeaturesetJobArmPaginatedResult, 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(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.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 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 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 = { - 'description': {'key': 'description', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'feature_window': {'key': 'featureWindow', 'type': 'FeatureWindow'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :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 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.description = kwargs.get('description', None) - self.display_name = kwargs.get('display_name', None) - self.feature_window = kwargs.get('feature_window', None) - self.resource = kwargs.get('resource', None) - self.spark_configuration = kwargs.get('spark_configuration', None) - self.tags = kwargs.get('tags', 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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(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.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(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.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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 FileSystemSource(DataImportSource): - """FileSystemSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - :ivar path: Path on data import FileSystem source. - :vartype path: str - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - :keyword path: Path on data import FileSystem source. - :paramtype path: str - """ - super(FileSystemSource, self).__init__(**kwargs) - self.source_type = 'file_system' # type: str - self.path = kwargs.get('path', 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, StaticInputData, TrailingInputData. - - 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", "Trailing", "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', 'Static': 'StaticInputData', 'Trailing': 'TrailingInputData'} - } - - 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", "Trailing", "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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', 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 features_unknown_at_forecast_time: The feature columns that are available for training - but unknown at the time of forecast/inference. - If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in - the dataset are known at inference time. - :vartype features_unknown_at_forecast_time: list[str] - :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'}, - 'features_unknown_at_forecast_time': {'key': 'featuresUnknownAtForecastTime', '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 features_unknown_at_forecast_time: The feature columns that are available for training - but unknown at the time of forecast/inference. - If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in - the dataset are known at inference time. - :paramtype features_unknown_at_forecast_time: list[str] - :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.features_unknown_at_forecast_time = kwargs.get('features_unknown_at_forecast_time', 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - '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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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. - - 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". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :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 = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', '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". - :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.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. - - 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". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :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 = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', '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". - :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 GenerationSafetyQualityMetricThreshold(msrest.serialization.Model): - """Generation safety quality metric threshold definition. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "AcceptableGroundednessScorePerInstance", - "AggregatedGroundednessPassRate", "AcceptableCoherenceScorePerInstance", - "AggregatedCoherencePassRate", "AcceptableFluencyScorePerInstance", - "AggregatedFluencyPassRate", "AcceptableSimilarityScorePerInstance", - "AggregatedSimilarityPassRate", "AcceptableRelevanceScorePerInstance", - "AggregatedRelevancePassRate". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetric - :ivar threshold: Gets or sets 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] Gets or sets the feature attribution metric to calculate. - Possible values include: "AcceptableGroundednessScorePerInstance", - "AggregatedGroundednessPassRate", "AcceptableCoherenceScorePerInstance", - "AggregatedCoherencePassRate", "AcceptableFluencyScorePerInstance", - "AggregatedFluencyPassRate", "AcceptableSimilarityScorePerInstance", - "AggregatedSimilarityPassRate", "AcceptableRelevanceScorePerInstance", - "AggregatedRelevancePassRate". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetric - :keyword threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(GenerationSafetyQualityMetricThreshold, self).__init__(**kwargs) - self.metric = kwargs['metric'] - self.threshold = kwargs.get('threshold', None) - - -class GenerationSafetyQualityMonitoringSignal(MonitoringSignalBase): - """Generation safety quality monitoring signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :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", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetricThreshold] - :ivar production_data: Gets or sets the target data for computing metrics. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar sampling_rate: Required. [Required] The sample rate of the target data, should be greater - than 0 and at most 1. - :vartype sampling_rate: float - :ivar workspace_connection_id: Gets or sets the workspace connection ID used to connect to the - content generation endpoint. - :vartype workspace_connection_id: str - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'sampling_rate': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[GenerationSafetyQualityMetricThreshold]'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - 'workspace_connection_id': {'key': 'workspaceConnectionId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetricThreshold] - :keyword production_data: Gets or sets the target data for computing metrics. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword sampling_rate: Required. [Required] The sample rate of the target data, should be - greater than 0 and at most 1. - :paramtype sampling_rate: float - :keyword workspace_connection_id: Gets or sets the workspace connection ID used to connect to - the content generation endpoint. - :paramtype workspace_connection_id: str - """ - super(GenerationSafetyQualityMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'GenerationSafetyQuality' # type: str - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs.get('production_data', None) - self.sampling_rate = kwargs['sampling_rate'] - self.workspace_connection_id = kwargs.get('workspace_connection_id', None) - - -class GenerationTokenStatisticsMetricThreshold(msrest.serialization.Model): - """Generation token statistics metric threshold definition. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "TotalTokenCount", "TotalTokenCountPerGroup". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.GenerationTokenStatisticsMetric - :ivar threshold: Gets or sets 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] Gets or sets the feature attribution metric to calculate. - Possible values include: "TotalTokenCount", "TotalTokenCountPerGroup". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.GenerationTokenStatisticsMetric - :keyword threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(GenerationTokenStatisticsMetricThreshold, self).__init__(**kwargs) - self.metric = kwargs['metric'] - self.threshold = kwargs.get('threshold', None) - - -class GenerationTokenStatisticsSignal(MonitoringSignalBase): - """Generation token statistics signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :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", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationTokenStatisticsMetricThreshold] - :ivar production_data: Gets or sets the target data for computing metrics. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar sampling_rate: Required. [Required] The sample rate of the target data, should be greater - than 0 and at most 1. - :vartype sampling_rate: float - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'sampling_rate': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[GenerationTokenStatisticsMetricThreshold]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationTokenStatisticsMetricThreshold] - :keyword production_data: Gets or sets the target data for computing metrics. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword sampling_rate: Required. [Required] The sample rate of the target data, should be - greater than 0 and at most 1. - :paramtype sampling_rate: float - """ - super(GenerationTokenStatisticsSignal, self).__init__(**kwargs) - self.signal_type = 'GenerationTokenStatistics' # type: str - self.metric_thresholds = kwargs['metric_thresholds'] - self.production_data = kwargs.get('production_data', None) - self.sampling_rate = kwargs['sampling_rate'] - - -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(DatastoreProperties): - """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", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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, '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'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - '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 intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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 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 images. Possible values include: "docker", "azureml". Default value: "docker". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :ivar reference: Image reference URL. - :vartype reference: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', '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 images. Possible values include: "docker", "azureml". Default value: "docker". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :keyword reference: Image reference URL. - :paramtype reference: 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) - - -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. - - :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 - """ - - _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'}, - } - - 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) - - -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 log_training_metrics: Enable computing and logging training metrics. Possible values - include: "Enable", "Disable". - :vartype log_training_metrics: str or - ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics - :ivar log_validation_loss: Enable computing and logging validation loss. Possible values - include: "Enable", "Disable". - :vartype log_validation_loss: str or - ~azure.mgmt.machinelearningservices.models.LogValidationLoss - :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'}, - 'log_training_metrics': {'key': 'logTrainingMetrics', 'type': 'str'}, - 'log_validation_loss': {'key': 'logValidationLoss', 'type': 'str'}, - '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 log_training_metrics: Enable computing and logging training metrics. Possible values - include: "Enable", "Disable". - :paramtype log_training_metrics: str or - ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics - :keyword log_validation_loss: Enable computing and logging validation loss. Possible values - include: "Enable", "Disable". - :paramtype log_validation_loss: str or - ~azure.mgmt.machinelearningservices.models.LogValidationLoss - :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.log_training_metrics = kwargs.get('log_training_metrics', None) - self.log_validation_loss = kwargs.get('log_validation_loss', 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 ImportDataAction(ScheduleActionBase): - """ImportDataAction. - - 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", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar data_import_definition: Required. [Required] Defines Schedule action definition details. - :vartype data_import_definition: ~azure.mgmt.machinelearningservices.models.DataImport - """ - - _validation = { - 'action_type': {'required': True}, - 'data_import_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'data_import_definition': {'key': 'dataImportDefinition', 'type': 'DataImport'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_import_definition: Required. [Required] Defines Schedule action definition - details. - :paramtype data_import_definition: ~azure.mgmt.machinelearningservices.models.DataImport - """ - super(ImportDataAction, self).__init__(**kwargs) - self.action_type = 'ImportData' # type: str - self.data_import_definition = kwargs['data_import_definition'] - - -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 IntellectualProperty(msrest.serialization.Model): - """Intellectual Property details for a resource. - - All required parameters must be populated in order to send to Azure. - - :ivar protection_level: Protection level of the Intellectual Property. Possible values include: - "All", "None". - :vartype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :ivar publisher: Required. [Required] Publisher of the Intellectual Property. Must be the same - as Registry publisher name. - :vartype publisher: str - """ - - _validation = { - 'publisher': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'protection_level': {'key': 'protectionLevel', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword protection_level: Protection level of the Intellectual Property. Possible values - include: "All", "None". - :paramtype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :keyword publisher: Required. [Required] Publisher of the Intellectual Property. Must be the - same as Registry publisher name. - :paramtype publisher: str - """ - super(IntellectualProperty, self).__init__(**kwargs) - self.protection_level = kwargs.get('protection_level', None) - self.publisher = kwargs['publisher'] - - -class JobBase(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.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 locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :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'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - '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 locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :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", "ImportData", - "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 set by user. - :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 set by user. - :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 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, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, '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, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, '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'] - - -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, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, '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'] - - -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 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 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 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 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 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 LabelCategory(msrest.serialization.Model): - """Label category definition. - - :ivar classes: Dictionary of label classes in this category. - :vartype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :ivar display_name: Display name of the label category. - :vartype display_name: str - :ivar multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :vartype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - - _attribute_map = { - 'classes': {'key': 'classes', 'type': '{LabelClass}'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'multi_select': {'key': 'multiSelect', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword classes: Dictionary of label classes in this category. - :paramtype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :keyword display_name: Display name of the label category. - :paramtype display_name: str - :keyword multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :paramtype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - super(LabelCategory, self).__init__(**kwargs) - self.classes = kwargs.get('classes', None) - self.display_name = kwargs.get('display_name', None) - self.multi_select = kwargs.get('multi_select', None) - - -class LabelClass(msrest.serialization.Model): - """Label class definition. - - :ivar display_name: Display name of the label class. - :vartype display_name: str - :ivar subclasses: Dictionary of subclasses of the label class. - :vartype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword display_name: Display name of the label class. - :paramtype display_name: str - :keyword subclasses: Dictionary of subclasses of the label class. - :paramtype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - super(LabelClass, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.subclasses = kwargs.get('subclasses', None) - - -class LabelingDataConfiguration(msrest.serialization.Model): - """Labeling data configuration definition. - - :ivar data_id: Resource Id of the data asset to perform labeling. - :vartype data_id: str - :ivar incremental_data_refresh: Indicates whether to enable incremental data refresh. Possible - values include: "Enabled", "Disabled". - :vartype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - - _attribute_map = { - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'incremental_data_refresh': {'key': 'incrementalDataRefresh', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword data_id: Resource Id of the data asset to perform labeling. - :paramtype data_id: str - :keyword incremental_data_refresh: Indicates whether to enable incremental data refresh. - Possible values include: "Enabled", "Disabled". - :paramtype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - super(LabelingDataConfiguration, self).__init__(**kwargs) - self.data_id = kwargs.get('data_id', None) - self.incremental_data_refresh = kwargs.get('incremental_data_refresh', None) - - -class LabelingJob(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.LabelingJobProperties - """ - - _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': 'LabelingJobProperties'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - super(LabelingJob, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class LabelingJobMediaProperties(msrest.serialization.Model): - """Properties of a labeling job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LabelingJobImageProperties, LabelingJobTextProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - } - - _subtype_map = { - 'media_type': {'Image': 'LabelingJobImageProperties', 'Text': 'LabelingJobTextProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(LabelingJobMediaProperties, self).__init__(**kwargs) - self.media_type = None # type: Optional[str] - - -class LabelingJobImageProperties(LabelingJobMediaProperties): - """Properties of a labeling job for image data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - super(LabelingJobImageProperties, self).__init__(**kwargs) - self.media_type = 'Image' # type: str - self.annotation_type = kwargs.get('annotation_type', None) - - -class LabelingJobInstructions(msrest.serialization.Model): - """Instructions for labeling job. - - :ivar uri: The link to a page with detailed labeling instructions for labelers. - :vartype uri: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword uri: The link to a page with detailed labeling instructions for labelers. - :paramtype uri: str - """ - super(LabelingJobInstructions, self).__init__(**kwargs) - self.uri = kwargs.get('uri', None) - - -class LabelingJobProperties(JobBaseProperties): - """Labeling 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", "Labeling", "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 secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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 created_date_time: Created time of the job in UTC timezone. - :vartype created_date_time: ~datetime.datetime - :ivar data_configuration: Configuration of data used in the job. - :vartype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :ivar job_instructions: Labeling instructions of the job. - :vartype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :ivar label_categories: Label categories of the job. - :vartype label_categories: dict[str, ~azure.mgmt.machinelearningservices.models.LabelCategory] - :ivar labeling_job_media_properties: Media type specific properties in the job. - :vartype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :ivar ml_assist_configuration: Configuration of MLAssist feature in the job. - :vartype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - :ivar progress_metrics: Progress metrics of the job. - :vartype progress_metrics: ~azure.mgmt.machinelearningservices.models.ProgressMetrics - :ivar project_id: Internal id of the job(Previously called project). - :vartype project_id: str - :ivar provisioning_state: Specifies the labeling job provisioning state. Possible values - include: "Succeeded", "Failed", "Canceled", "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.JobProvisioningState - :ivar status_messages: Status messages of the job. - :vartype status_messages: list[~azure.mgmt.machinelearningservices.models.StatusMessage] - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'progress_metrics': {'readonly': True}, - 'project_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status_messages': {'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'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'data_configuration': {'key': 'dataConfiguration', 'type': 'LabelingDataConfiguration'}, - 'job_instructions': {'key': 'jobInstructions', 'type': 'LabelingJobInstructions'}, - 'label_categories': {'key': 'labelCategories', 'type': '{LabelCategory}'}, - 'labeling_job_media_properties': {'key': 'labelingJobMediaProperties', 'type': 'LabelingJobMediaProperties'}, - 'ml_assist_configuration': {'key': 'mlAssistConfiguration', 'type': 'MLAssistConfiguration'}, - 'progress_metrics': {'key': 'progressMetrics', 'type': 'ProgressMetrics'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status_messages': {'key': 'statusMessages', 'type': '[StatusMessage]'}, - } - - 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 secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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_configuration: Configuration of data used in the job. - :paramtype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :keyword job_instructions: Labeling instructions of the job. - :paramtype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :keyword label_categories: Label categories of the job. - :paramtype label_categories: dict[str, - ~azure.mgmt.machinelearningservices.models.LabelCategory] - :keyword labeling_job_media_properties: Media type specific properties in the job. - :paramtype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :keyword ml_assist_configuration: Configuration of MLAssist feature in the job. - :paramtype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - """ - super(LabelingJobProperties, self).__init__(**kwargs) - self.job_type = 'Labeling' # type: str - self.created_date_time = None - self.data_configuration = kwargs.get('data_configuration', None) - self.job_instructions = kwargs.get('job_instructions', None) - self.label_categories = kwargs.get('label_categories', None) - self.labeling_job_media_properties = kwargs.get('labeling_job_media_properties', None) - self.ml_assist_configuration = kwargs.get('ml_assist_configuration', None) - self.progress_metrics = None - self.project_id = None - self.provisioning_state = None - self.status_messages = None - - -class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of LabelingJob entities. - - :ivar next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type LabelingJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[LabelingJob]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type LabelingJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - super(LabelingJobResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) - - -class LabelingJobTextProperties(LabelingJobMediaProperties): - """Properties of a labeling job for text data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - super(LabelingJobTextProperties, self).__init__(**kwargs) - self.media_type = 'Text' # type: str - self.annotation_type = kwargs.get('annotation_type', 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] Monitor compute identity type enum.Constant - filled by server. Possible values include: "AmlToken", "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :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: Managed service identity (system assigned and/or user assigned identities). - :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. - - 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", "AccessKey", "ApiKey", "CustomKeys". - :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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - '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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :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 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 - """ - - _validation = { - 'network_id': {'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'}, - } - - 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) - - -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 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 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 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 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 MLAssistConfiguration(msrest.serialization.Model): - """Labeling MLAssist configuration definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLAssistConfigurationDisabled, MLAssistConfigurationEnabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - _subtype_map = { - 'ml_assist': {'Disabled': 'MLAssistConfigurationDisabled', 'Enabled': 'MLAssistConfigurationEnabled'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfiguration, self).__init__(**kwargs) - self.ml_assist = None # type: Optional[str] - - -class MLAssistConfigurationDisabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is disabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfigurationDisabled, self).__init__(**kwargs) - self.ml_assist = 'Disabled' # type: str - - -class MLAssistConfigurationEnabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is enabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - :ivar inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :vartype inferencing_compute_binding: str - :ivar training_compute_binding: Required. [Required] AML compute binding used in training. - :vartype training_compute_binding: str - """ - - _validation = { - 'ml_assist': {'required': True}, - 'inferencing_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - 'inferencing_compute_binding': {'key': 'inferencingComputeBinding', 'type': 'str'}, - 'training_compute_binding': {'key': 'trainingComputeBinding', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :paramtype inferencing_compute_binding: str - :keyword training_compute_binding: Required. [Required] AML compute binding used in training. - :paramtype training_compute_binding: str - """ - super(MLAssistConfigurationEnabled, self).__init__(**kwargs) - self.ml_assist = 'Enabled' # type: str - self.inferencing_compute_binding = kwargs['inferencing_compute_binding'] - self.training_compute_binding = kwargs['training_compute_binding'] - - -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 asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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 asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: 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}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', '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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: 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 asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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 asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', 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 ModelConfiguration(msrest.serialization.Model): - """Model configuration options. - - :ivar mode: Input delivery mode for the model. Possible values include: "Copy", "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mounting path of the model in the target image. - :vartype mount_path: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: Input delivery mode for the model. Possible values include: "Copy", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mounting path of the model in the target image. - :paramtype mount_path: str - """ - super(ModelConfiguration, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.mount_path = kwargs.get('mount_path', None) - - -class ModelContainer(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.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 ModelPackageInput(msrest.serialization.Model): - """Model package input options. - - All required parameters must be populated in order to send to Azure. - - :ivar input_type: Required. [Required] Type of the input included in the target image. Possible - values include: "UriFile", "UriFolder". - :vartype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :ivar mode: Input delivery mode of the input. Possible values include: "Copy", "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mount path of the input in the target image. - :vartype mount_path: str - :ivar path: Required. [Required] Location of the input. - :vartype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - - _validation = { - 'input_type': {'required': True}, - 'path': {'required': True}, - } - - _attribute_map = { - 'input_type': {'key': 'inputType', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'PackageInputPathBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword input_type: Required. [Required] Type of the input included in the target image. - Possible values include: "UriFile", "UriFolder". - :paramtype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :keyword mode: Input delivery mode of the input. Possible values include: "Copy", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mount path of the input in the target image. - :paramtype mount_path: str - :keyword path: Required. [Required] Location of the input. - :paramtype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - super(ModelPackageInput, self).__init__(**kwargs) - self.input_type = kwargs['input_type'] - self.mode = kwargs.get('mode', None) - self.mount_path = kwargs.get('mount_path', None) - self.path = kwargs['path'] - - -class ModelPerformanceSignal(MonitoringSignalBase): - """Model performance signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :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", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar data_segment: The data segment. - :vartype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :ivar metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_threshold: - ~azure.mgmt.machinelearningservices.models.ModelPerformanceMetricThresholdBase - :ivar production_data: Required. [Required] The data produced by the production service 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}, - 'metric_threshold': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'ModelPerformanceMetricThresholdBase'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword data_segment: The data segment. - :paramtype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :keyword metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_threshold: - ~azure.mgmt.machinelearningservices.models.ModelPerformanceMetricThresholdBase - :keyword production_data: Required. [Required] The data produced by the production service - 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(ModelPerformanceSignal, self).__init__(**kwargs) - self.signal_type = 'ModelPerformance' # type: str - self.data_segment = kwargs.get('data_segment', None) - self.metric_threshold = kwargs['metric_threshold'] - self.production_data = kwargs['production_data'] - self.reference_data = kwargs['reference_data'] - - -class ModelVersion(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.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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar flavors: Mapping of model flavors to their properties. - :vartype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :ivar intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - '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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword flavors: Mapping of model flavors to their properties. - :paramtype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :keyword intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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.intellectual_property = kwargs.get('intellectual_property', 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_setting: The monitor's notification settings. - :vartype alert_notification_setting: - ~azure.mgmt.machinelearningservices.models.MonitoringAlertNotificationSettingsBase - :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 ARM resource ID of either the model or deployment targeted by this - 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_setting': {'key': 'alertNotificationSetting', 'type': 'MonitoringAlertNotificationSettingsBase'}, - 'compute_configuration': {'key': 'computeConfiguration', 'type': 'MonitorComputeConfigurationBase'}, - 'monitoring_target': {'key': 'monitoringTarget', 'type': 'MonitoringTarget'}, - 'signals': {'key': 'signals', 'type': '{MonitoringSignalBase}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword alert_notification_setting: The monitor's notification settings. - :paramtype alert_notification_setting: - ~azure.mgmt.machinelearningservices.models.MonitoringAlertNotificationSettingsBase - :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 ARM resource ID of either the model or deployment targeted by - this 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_setting = kwargs.get('alert_notification_setting', None) - self.compute_configuration = kwargs['compute_configuration'] - self.monitoring_target = kwargs.get('monitoring_target', None) - self.signals = kwargs['signals'] - - -class MonitoringDataSegment(msrest.serialization.Model): - """MonitoringDataSegment. - - :ivar feature: The feature to segment the data on. - :vartype feature: str - :ivar values: Filters for only the specified values of the given segmented feature. - :vartype values: list[str] - """ - - _attribute_map = { - 'feature': {'key': 'feature', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword feature: The feature to segment the data on. - :paramtype feature: str - :keyword values: Filters for only the specified values of the given segmented feature. - :paramtype values: list[str] - """ - super(MonitoringDataSegment, self).__init__(**kwargs) - self.feature = kwargs.get('feature', None) - self.values = kwargs.get('values', None) - - -class MonitoringTarget(msrest.serialization.Model): - """Monitoring target definition. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_id: The ARM resource ID of either the deployment targeted by this monitor. - :vartype deployment_id: str - :ivar model_id: The ARM resource ID of either the model targeted by this monitor. - :vartype model_id: str - :ivar task_type: Required. [Required] The machine learning task type of the model. Possible - values include: "Classification", "Regression", "QuestionAnswering". - :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: The ARM resource ID of either the deployment targeted by this monitor. - :paramtype deployment_id: str - :keyword model_id: The ARM resource ID of either the model targeted by this monitor. - :paramtype model_id: str - :keyword task_type: Required. [Required] The machine learning task type of the model. Possible - values include: "Classification", "Regression", "QuestionAnswering". - :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 MonitoringWorkspaceConnection(msrest.serialization.Model): - """Monitoring workspace connection definition. - - :ivar environment_variables: The properties of a workspace service connection to store as - environment variables in the submitted jobs. - Key is workspace connection property path, name is environment variable key. - :vartype environment_variables: dict[str, str] - :ivar secrets: The properties of a workspace service connection to store as secrets in the - submitted jobs. - Key is workspace connection property path, name is secret key. - :vartype secrets: dict[str, str] - """ - - _attribute_map = { - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'secrets': {'key': 'secrets', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword environment_variables: The properties of a workspace service connection to store as - environment variables in the submitted jobs. - Key is workspace connection property path, name is environment variable key. - :paramtype environment_variables: dict[str, str] - :keyword secrets: The properties of a workspace service connection to store as secrets in the - submitted jobs. - Key is workspace connection property path, name is secret key. - :paramtype secrets: dict[str, str] - """ - super(MonitoringWorkspaceConnection, self).__init__(**kwargs) - self.environment_variables = kwargs.get('environment_variables', None) - self.secrets = kwargs.get('secrets', 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'[a-zA-Z0-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", - "Ray". - :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 NlpFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML NLP training. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: int - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: int - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: int - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: int - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: float - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: float - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'float'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: int - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: int - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: int - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: int - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: float - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: float - """ - super(NlpFixedParameters, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get('gradient_accumulation_steps', 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.number_of_epochs = kwargs.get('number_of_epochs', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_ratio = kwargs.get('warmup_ratio', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class NlpParameterSubspace(msrest.serialization.Model): - """Stringified search spaces for each parameter. See below examples. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :vartype learning_rate_scheduler: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: str - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: str - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: str - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: str - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: str - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :paramtype learning_rate_scheduler: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: str - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: str - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: str - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: str - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: str - """ - super(NlpParameterSubspace, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get('gradient_accumulation_steps', 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.number_of_epochs = kwargs.get('number_of_epochs', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_ratio = kwargs.get('warmup_ratio', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class NlpSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter tuning related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. 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 for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(NlpSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - - -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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_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_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Timeout for individual HD trials. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Timeout for individual HD trials. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_nodes = kwargs.get('max_nodes', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") - self.trial_timeout = kwargs.get('trial_timeout', 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", "AccessKey", "ApiKey", "CustomKeys". - :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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - 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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - """ - 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", "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 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 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", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - '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 intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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 OnlineInferenceConfiguration(msrest.serialization.Model): - """Online inference configuration options. - - :ivar configurations: Additional configurations. - :vartype configurations: dict[str, str] - :ivar entry_script: Entry script or command to invoke. - :vartype entry_script: str - :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 = { - 'configurations': {'key': 'configurations', 'type': '{str}'}, - 'entry_script': {'key': 'entryScript', 'type': 'str'}, - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword configurations: Additional configurations. - :paramtype configurations: dict[str, str] - :keyword entry_script: Entry script or command to invoke. - :paramtype entry_script: str - :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(OnlineInferenceConfiguration, self).__init__(**kwargs) - self.configurations = kwargs.get('configurations', None) - self.entry_script = kwargs.get('entry_script', None) - 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 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 OperationDisplay(msrest.serialization.Model): - """Display name of operation. - - :ivar description: Gets or sets the description for the operation. - :vartype description: str - :ivar operation: Gets or sets the operation that users can perform. - :vartype operation: str - :ivar provider: Gets or sets the resource provider name: - Microsoft.MachineLearningExperimentation. - :vartype provider: str - :ivar resource: Gets or sets the resource on which the operation is performed. - :vartype resource: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword description: Gets or sets the description for the operation. - :paramtype description: str - :keyword operation: Gets or sets the operation that users can perform. - :paramtype operation: str - :keyword provider: Gets or sets the resource provider name: - Microsoft.MachineLearningExperimentation. - :paramtype provider: str - :keyword resource: Gets or sets the resource on which the operation is performed. - :paramtype resource: str - """ - super(OperationDisplay, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.operation = kwargs.get('operation', None) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - - -class OutboundRuleBasicResource(Resource): - """Outbound Rule Basic Resource 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 id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the 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 PackageInputPathBase(msrest.serialization.Model): - """PackageInputPathBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: PackageInputPathId, PackageInputPathVersion, PackageInputPathUrl. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - } - - _subtype_map = { - 'input_path_type': {'PathId': 'PackageInputPathId', 'PathVersion': 'PackageInputPathVersion', 'Url': 'PackageInputPathUrl'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PackageInputPathBase, self).__init__(**kwargs) - self.input_path_type = None # type: Optional[str] - - -class PackageInputPathId(PackageInputPathBase): - """Package input path specified with a resource id. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_id: Input resource id. - :vartype resource_id: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_id: Input resource id. - :paramtype resource_id: str - """ - super(PackageInputPathId, self).__init__(**kwargs) - self.input_path_type = 'PathId' # type: str - self.resource_id = kwargs.get('resource_id', None) - - -class PackageInputPathUrl(PackageInputPathBase): - """Package input path specified as an url. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar url: Input path url. - :vartype url: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword url: Input path url. - :paramtype url: str - """ - super(PackageInputPathUrl, self).__init__(**kwargs) - self.input_path_type = 'Url' # type: str - self.url = kwargs.get('url', None) - - -class PackageInputPathVersion(PackageInputPathBase): - """Package input path specified with name and version. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_name: Input resource name. - :vartype resource_name: str - :ivar resource_version: Input resource version. - :vartype resource_version: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_name': {'key': 'resourceName', 'type': 'str'}, - 'resource_version': {'key': 'resourceVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword resource_name: Input resource name. - :paramtype resource_name: str - :keyword resource_version: Input resource version. - :paramtype resource_version: str - """ - super(PackageInputPathVersion, self).__init__(**kwargs) - self.input_path_type = 'PathVersion' # type: str - self.resource_name = kwargs.get('resource_name', None) - self.resource_version = kwargs.get('resource_version', None) - - -class PackageRequest(msrest.serialization.Model): - """Model package operation request properties. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Required. [Required] Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_id: Required. [Required] Arm ID of the target environment to be - created by package operation. - :vartype target_environment_id: str - """ - - _validation = { - 'inferencing_server': {'required': True}, - 'target_environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword base_environment_source: Base environment to start with. - :paramtype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :keyword environment_variables: Collection of environment variables. - :paramtype environment_variables: dict[str, str] - :keyword inferencing_server: Required. [Required] Inferencing server configurations. - :paramtype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :keyword inputs: Collection of inputs. - :paramtype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :keyword model_configuration: Model configuration including the mount mode. - :paramtype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword target_environment_id: Required. [Required] Arm ID of the target environment to be - created by package operation. - :paramtype target_environment_id: str - """ - super(PackageRequest, self).__init__(**kwargs) - self.base_environment_source = kwargs.get('base_environment_source', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.inferencing_server = kwargs['inferencing_server'] - self.inputs = kwargs.get('inputs', None) - self.model_configuration = kwargs.get('model_configuration', None) - self.tags = kwargs.get('tags', None) - self.target_environment_id = kwargs['target_environment_id'] - - -class PackageResponse(msrest.serialization.Model): - """Package response returned after async package operation completes successfully. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar build_id: Build id of the image build operation. - :vartype build_id: str - :ivar build_state: Build state of the image build operation. Possible values include: - "NotStarted", "Running", "Succeeded", "Failed". - :vartype build_state: str or ~azure.mgmt.machinelearningservices.models.PackageBuildState - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar log_url: Log url of the image build operation. - :vartype log_url: str - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_id: Asset ID of the target environment created by package operation. - :vartype target_environment_id: str - """ - - _validation = { - 'base_environment_source': {'readonly': True}, - 'build_id': {'readonly': True}, - 'build_state': {'readonly': True}, - 'environment_variables': {'readonly': True}, - 'inferencing_server': {'readonly': True}, - 'inputs': {'readonly': True}, - 'log_url': {'readonly': True}, - 'model_configuration': {'readonly': True}, - 'tags': {'readonly': True}, - 'target_environment_id': {'readonly': True}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'build_id': {'key': 'buildId', 'type': 'str'}, - 'build_state': {'key': 'buildState', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'log_url': {'key': 'logUrl', 'type': 'str'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PackageResponse, self).__init__(**kwargs) - self.base_environment_source = None - self.build_id = None - self.build_state = None - self.environment_variables = None - self.inferencing_server = None - self.inputs = None - self.log_url = None - self.model_configuration = None - self.tags = None - self.target_environment_id = 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 PartialJobBase(msrest.serialization.Model): - """Mutable base definition for a job. - - :ivar notification_setting: Mutable notification setting for the job. - :vartype notification_setting: - ~azure.mgmt.machinelearningservices.models.PartialNotificationSetting - """ - - _attribute_map = { - 'notification_setting': {'key': 'notificationSetting', 'type': 'PartialNotificationSetting'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword notification_setting: Mutable notification setting for the job. - :paramtype notification_setting: - ~azure.mgmt.machinelearningservices.models.PartialNotificationSetting - """ - super(PartialJobBase, self).__init__(**kwargs) - self.notification_setting = kwargs.get('notification_setting', None) - - -class PartialJobBasePartialResource(msrest.serialization.Model): - """Azure Resource Manager resource envelope strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialJobBase - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialJobBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialJobBase - """ - super(PartialJobBasePartialResource, self).__init__(**kwargs) - self.properties = kwargs.get('properties', 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 PartialNotificationSetting(msrest.serialization.Model): - """Mutable configuration for notification. - - :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 = { - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, - } - - def __init__( - self, - **kwargs - ): - """ - :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(PartialNotificationSetting, self).__init__(**kwargs) - self.webhooks = kwargs.get('webhooks', 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. - - 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", "AccessKey", "ApiKey", "CustomKeys". - :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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - '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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :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", "Labeling", "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 secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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 - :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'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - '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 secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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 mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :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", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :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 model_type: Required. [Required] The type of the model monitored. Possible values - include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :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}, - 'model_type': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[PredictionDriftMetricThresholdBase]'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :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 model_type: Required. [Required] The type of the model monitored. Possible values - include: "Classification", "Regression". - :paramtype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :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.metric_thresholds = kwargs['metric_thresholds'] - self.model_type = kwargs['model_type'] - 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}, - 'provisioning_state': {'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 - """ - 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 = 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. - - 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". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :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 - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'PrivateEndpointDestination'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :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 - """ - super(PrivateEndpointOutboundRule, self).__init__(**kwargs) - self.type = 'PrivateEndpoint' # type: str - self.destination = kwargs.get('destination', 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 ProgressMetrics(msrest.serialization.Model): - """Progress metrics definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar completed_datapoint_count: The completed datapoint count. - :vartype completed_datapoint_count: long - :ivar incremental_data_last_refresh_date_time: The time of last successful incremental data - refresh in UTC. - :vartype incremental_data_last_refresh_date_time: ~datetime.datetime - :ivar skipped_datapoint_count: The skipped datapoint count. - :vartype skipped_datapoint_count: long - :ivar total_datapoint_count: The total datapoint count. - :vartype total_datapoint_count: long - """ - - _validation = { - 'completed_datapoint_count': {'readonly': True}, - 'incremental_data_last_refresh_date_time': {'readonly': True}, - 'skipped_datapoint_count': {'readonly': True}, - 'total_datapoint_count': {'readonly': True}, - } - - _attribute_map = { - 'completed_datapoint_count': {'key': 'completedDatapointCount', 'type': 'long'}, - 'incremental_data_last_refresh_date_time': {'key': 'incrementalDataLastRefreshDateTime', 'type': 'iso-8601'}, - 'skipped_datapoint_count': {'key': 'skippedDatapointCount', 'type': 'long'}, - 'total_datapoint_count': {'key': 'totalDatapointCount', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProgressMetrics, self).__init__(**kwargs) - self.completed_datapoint_count = None - self.incremental_data_last_refresh_date_time = None - self.skipped_datapoint_count = None - self.total_datapoint_count = 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", - "Ray". - :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 - :ivar priority: Controls the priority of the job on a compute. - :vartype priority: int - """ - - _attribute_map = { - 'job_tier': {'key': 'jobTier', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - } - - 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 - :keyword priority: Controls the priority of the job on a compute. - :paramtype priority: int - """ - super(QueueSettings, self).__init__(**kwargs) - self.job_tier = kwargs.get('job_tier', None) - self.priority = kwargs.get('priority', 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 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 logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :vartype logbase: str - :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'}, - 'logbase': {'key': 'logbase', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :paramtype logbase: str - :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.logbase = kwargs.get('logbase', None) - self.rule = kwargs.get('rule', None) - self.seed = kwargs.get('seed', None) - - -class Ray(DistributionConfiguration): - """Ray 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", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar address: The address of Ray head node. - :vartype address: str - :ivar dashboard_port: The port to bind the dashboard server to. - :vartype dashboard_port: int - :ivar head_node_additional_args: Additional arguments passed to ray start in head node. - :vartype head_node_additional_args: str - :ivar include_dashboard: Provide this argument to start the Ray dashboard GUI. - :vartype include_dashboard: bool - :ivar port: The port of the head ray process. - :vartype port: int - :ivar worker_node_additional_args: Additional arguments passed to ray start in worker node. - :vartype worker_node_additional_args: str - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'address': {'key': 'address', 'type': 'str'}, - 'dashboard_port': {'key': 'dashboardPort', 'type': 'int'}, - 'head_node_additional_args': {'key': 'headNodeAdditionalArgs', 'type': 'str'}, - 'include_dashboard': {'key': 'includeDashboard', 'type': 'bool'}, - 'port': {'key': 'port', 'type': 'int'}, - 'worker_node_additional_args': {'key': 'workerNodeAdditionalArgs', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword address: The address of Ray head node. - :paramtype address: str - :keyword dashboard_port: The port to bind the dashboard server to. - :paramtype dashboard_port: int - :keyword head_node_additional_args: Additional arguments passed to ray start in head node. - :paramtype head_node_additional_args: str - :keyword include_dashboard: Provide this argument to start the Ray dashboard GUI. - :paramtype include_dashboard: bool - :keyword port: The port of the head ray process. - :paramtype port: int - :keyword worker_node_additional_args: Additional arguments passed to ray start in worker node. - :paramtype worker_node_additional_args: str - """ - super(Ray, self).__init__(**kwargs) - self.distribution_type = 'Ray' # type: str - self.address = kwargs.get('address', None) - self.dashboard_port = kwargs.get('dashboard_port', None) - self.head_node_additional_args = kwargs.get('head_node_additional_args', None) - self.include_dashboard = kwargs.get('include_dashboard', None) - self.port = kwargs.get('port', None) - self.worker_node_additional_args = kwargs.get('worker_node_additional_args', 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.RecurrenceFrequency - :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.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: [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] 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.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', "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 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 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'}, - '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 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.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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', 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 RegressionModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): - """RegressionModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :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 regression model performance metric to calculate. - Possible values include: "MeanAbsoluteError", "RootMeanSquaredError", "MeanSquaredError". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionModelPerformanceMetric - """ - - _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', '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 regression model performance metric to calculate. - Possible values include: "MeanAbsoluteError", "RootMeanSquaredError", "MeanSquaredError". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionModelPerformanceMetric - """ - super(RegressionModelPerformanceMetricThreshold, self).__init__(**kwargs) - self.model_type = 'Regression' # type: str - self.metric = kwargs['metric'] - - -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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - '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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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 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 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. - - 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", "AccessKey", "ApiKey", "CustomKeys". - :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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - '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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :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 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", "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 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(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.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 SecretConfiguration(msrest.serialization.Model): - """Secret Configuration definition. - - :ivar uri: Secret Uri. - Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion. - :vartype uri: str - :ivar workspace_secret_name: Name of secret in workspace key vault. - :vartype workspace_secret_name: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - 'workspace_secret_name': {'key': 'workspaceSecretName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword uri: Secret Uri. - Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion. - :paramtype uri: str - :keyword workspace_secret_name: Name of secret in workspace key vault. - :paramtype workspace_secret_name: str - """ - super(SecretConfiguration, self).__init__(**kwargs) - self.uri = kwargs.get('uri', None) - self.workspace_secret_name = kwargs.get('workspace_secret_name', None) - - -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. - - 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", "AccessKey", "ApiKey", "CustomKeys". - :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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - '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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :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", "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 ServiceTagDestination(msrest.serialization.Model): - """Service Tag destination for a 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. - - :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 - """ - - _validation = { - 'address_prefixes': {'readonly': True}, - } - - _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 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 = 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. - - 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". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :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 = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', '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". - :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", "Labeling", "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 secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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 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 resource 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 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'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - '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'}, - '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 secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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 resource 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 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.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 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", "Trailing", "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: The ARM resource ID of the component resource 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: The ARM resource ID of the component resource 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 StatusMessage(msrest.serialization.Model): - """Active message associated with project. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Service-defined message code. - :vartype code: str - :ivar created_date_time: Time in UTC at which the message was created. - :vartype created_date_time: ~datetime.datetime - :ivar level: Severity level of message. Possible values include: "Error", "Information", - "Warning". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.StatusMessageLevel - :ivar message: A human-readable representation of the message code. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(StatusMessage, self).__init__(**kwargs) - self.code = None - self.created_date_time = None - self.level = None - self.message = None - - -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", "Labeling", "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 secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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 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'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - '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 secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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 TableFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML Table training. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: int - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: int - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: int - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: int - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: float - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: int - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: int - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: float - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: float - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: float - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: float - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: bool - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: bool - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'max_bin': {'key': 'maxBin', 'type': 'int'}, - 'max_depth': {'key': 'maxDepth', 'type': 'int'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'int'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'int'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'float'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'int'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'int'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'float'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'float'}, - 'subsample': {'key': 'subsample', 'type': 'float'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'float'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'bool'}, - 'with_std': {'key': 'withStd', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: int - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: int - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: int - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: int - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: float - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: int - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: int - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: float - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: float - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: float - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: float - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: bool - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: bool - """ - super(TableFixedParameters, self).__init__(**kwargs) - self.booster = kwargs.get('booster', None) - self.boosting_type = kwargs.get('boosting_type', None) - self.grow_policy = kwargs.get('grow_policy', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.max_bin = kwargs.get('max_bin', None) - self.max_depth = kwargs.get('max_depth', None) - self.max_leaves = kwargs.get('max_leaves', None) - self.min_data_in_leaf = kwargs.get('min_data_in_leaf', None) - self.min_split_gain = kwargs.get('min_split_gain', None) - self.model_name = kwargs.get('model_name', None) - self.n_estimators = kwargs.get('n_estimators', None) - self.num_leaves = kwargs.get('num_leaves', None) - self.preprocessor_name = kwargs.get('preprocessor_name', None) - self.reg_alpha = kwargs.get('reg_alpha', None) - self.reg_lambda = kwargs.get('reg_lambda', None) - self.subsample = kwargs.get('subsample', None) - self.subsample_freq = kwargs.get('subsample_freq', None) - self.tree_method = kwargs.get('tree_method', None) - self.with_mean = kwargs.get('with_mean', False) - self.with_std = kwargs.get('with_std', False) - - -class TableParameterSubspace(msrest.serialization.Model): - """TableParameterSubspace. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: str - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: str - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: str - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: str - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: str - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: str - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: str - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: str - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: str - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: str - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: str - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: str - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'max_bin': {'key': 'maxBin', 'type': 'str'}, - 'max_depth': {'key': 'maxDepth', 'type': 'str'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'str'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'str'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'str'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'str'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'str'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'str'}, - 'subsample': {'key': 'subsample', 'type': 'str'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'str'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'str'}, - 'with_std': {'key': 'withStd', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: str - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: str - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: str - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: str - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: str - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: str - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: str - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: str - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: str - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: str - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: str - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: str - """ - super(TableParameterSubspace, self).__init__(**kwargs) - self.booster = kwargs.get('booster', None) - self.boosting_type = kwargs.get('boosting_type', None) - self.grow_policy = kwargs.get('grow_policy', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.max_bin = kwargs.get('max_bin', None) - self.max_depth = kwargs.get('max_depth', None) - self.max_leaves = kwargs.get('max_leaves', None) - self.min_data_in_leaf = kwargs.get('min_data_in_leaf', None) - self.min_split_gain = kwargs.get('min_split_gain', None) - self.model_name = kwargs.get('model_name', None) - self.n_estimators = kwargs.get('n_estimators', None) - self.num_leaves = kwargs.get('num_leaves', None) - self.preprocessor_name = kwargs.get('preprocessor_name', None) - self.reg_alpha = kwargs.get('reg_alpha', None) - self.reg_lambda = kwargs.get('reg_lambda', None) - self.subsample = kwargs.get('subsample', None) - self.subsample_freq = kwargs.get('subsample_freq', None) - self.tree_method = kwargs.get('tree_method', None) - self.with_mean = kwargs.get('with_mean', None) - self.with_std = kwargs.get('with_std', None) - - -class TableSweepSettings(msrest.serialization.Model): - """TableSweepSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. 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 for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(TableSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - - -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_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of iterations. - :vartype max_trials: int - :ivar sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to trigger. - :vartype sweep_concurrent_trials: int - :ivar sweep_trials: Number of sweeping runs that user wants to trigger. - :vartype sweep_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_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'sweep_concurrent_trials': {'key': 'sweepConcurrentTrials', 'type': 'int'}, - 'sweep_trials': {'key': 'sweepTrials', '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_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of iterations. - :paramtype max_trials: int - :keyword sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to - trigger. - :paramtype sweep_concurrent_trials: int - :keyword sweep_trials: Number of sweeping runs that user wants to trigger. - :paramtype sweep_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_nodes = kwargs.get('max_nodes', 1) - self.max_trials = kwargs.get('max_trials', 1000) - self.sweep_concurrent_trials = kwargs.get('sweep_concurrent_trials', 0) - self.sweep_trials = kwargs.get('sweep_trials', 0) - 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", - "Ray". - :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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - '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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_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 TrailingInputData(MonitoringInputDataBase): - """Trailing 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", "Trailing", "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: The ARM resource ID of the component resource 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 trailing 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: The ARM resource ID of the component resource 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 trailing data window. - :paramtype window_size: ~datetime.timedelta - """ - super(TrailingInputData, self).__init__(**kwargs) - self.input_data_type = 'Trailing' # 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 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 TritonInferencingServer(InferencingServer): - """Triton inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for Triton. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for Triton. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(TritonInferencingServer, self).__init__(**kwargs) - self.server_type = 'Triton' # type: str - self.inference_configuration = kwargs.get('inference_configuration', 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 asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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 asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: 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}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - '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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: 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 asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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 asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: 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}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - '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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: 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 asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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 asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', 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 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. - - 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", "AccessKey", "ApiKey", "CustomKeys". - :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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - '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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :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 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 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 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 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'}, - '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'}, - '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'}, - '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'}, - '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 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 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 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 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.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.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.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.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 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 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 username: - :vartype username: str - """ - - _attribute_map = { - 'password': {'key': 'password', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword password: - :paramtype password: str - :keyword username: - :paramtype username: str - """ - super(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.password = kwargs.get('password', 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 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 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 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 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 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}'}, - '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'}, - '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'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - '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 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 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 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 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 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.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.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.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.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.v1_legacy_mode = kwargs.get('v1_legacy_mode', None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/_models_py3.py deleted file mode 100644 index 824fef4839bb..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/_models_py3.py +++ /dev/null @@ -1,33299 +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: AccessKeyAuthTypeWorkspaceConnectionProperties, ApiKeyAuthWorkspaceConnectionProperties, CustomKeysWorkspaceConnectionProperties, 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", "AccessKey", "ApiKey", "CustomKeys". - :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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - _subtype_map = { - 'auth_type': {'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', 'ApiKey': 'ApiKeyAuthWorkspaceConnectionProperties', 'CustomKeys': 'CustomKeysWorkspaceConnectionProperties', 'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - metadata: Optional[Any] = None, - target: Optional[str] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - """ - super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) - self.auth_type = None # type: Optional[str] - self.category = category - self.expiry_time = expiry_time - self.metadata = metadata - self.target = target - - -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): - """AccessKeyAuthTypeWorkspaceConnectionProperties. - - 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", "AccessKey", "ApiKey", "CustomKeys". - :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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - metadata: Optional[Any] = None, - target: Optional[str] = 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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey - """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, metadata=metadata, target=target, **kwargs) - self.auth_type = 'AccessKey' # 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, 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 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", "Custom". - :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", "Custom". - :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 AmlOperation(msrest.serialization.Model): - """Azure Machine Learning team account REST API operation. - - :ivar display: Gets or sets display name of operation. - :vartype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - :ivar is_data_action: Indicates whether the operation applies to data-plane. - :vartype is_data_action: bool - :ivar name: Gets or sets operation name: {provider}/{resource}/{operation}. - :vartype name: str - :ivar origin: The intended executor of the operation: user/system. - :vartype origin: str - """ - - _attribute_map = { - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'origin': {'key': 'origin', 'type': 'str'}, - } - - def __init__( - self, - *, - display: Optional["OperationDisplay"] = None, - is_data_action: Optional[bool] = None, - name: Optional[str] = None, - origin: Optional[str] = None, - **kwargs - ): - """ - :keyword display: Gets or sets display name of operation. - :paramtype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay - :keyword is_data_action: Indicates whether the operation applies to data-plane. - :paramtype is_data_action: bool - :keyword name: Gets or sets operation name: {provider}/{resource}/{operation}. - :paramtype name: str - :keyword origin: The intended executor of the operation: user/system. - :paramtype origin: str - """ - super(AmlOperation, self).__init__(**kwargs) - self.display = display - self.is_data_action = is_data_action - self.name = name - self.origin = origin - - -class AmlOperationListResult(msrest.serialization.Model): - """An array of operations supported by the resource provider. - - :ivar value: Gets or sets list of AML team account operations supported by the - AML team account resource provider. - :vartype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlOperation]'}, - } - - def __init__( - self, - *, - value: Optional[List["AmlOperation"]] = None, - **kwargs - ): - """ - :keyword value: Gets or sets list of AML team account operations supported by the - AML team account resource provider. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] - """ - super(AmlOperationListResult, self).__init__(**kwargs) - self.value = value - - -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] Monitor compute identity type enum.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] Monitor compute identity type enum.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 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. - - 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", "AccessKey", "ApiKey", "CustomKeys". - :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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: Api key object for workspace connection credential. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionApiKey'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - metadata: Optional[Any] = None, - target: Optional[str] = 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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: Api key object for workspace connection credential. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionApiKey - """ - super(ApiKeyAuthWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, metadata=metadata, target=target, **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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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, - auto_delete_setting: Optional["AutoDeleteSetting"] = 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - """ - super(AssetBase, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.auto_delete_setting = auto_delete_setting - 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 asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: Optional[str] = None, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - mode: Optional[Union[str, "OutputDeliveryMode"]] = None, - uri: Optional[str] = None, - **kwargs - ): - """ - :keyword asset_name: Output Asset Name. - :paramtype asset_name: str - :keyword asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - 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 AutoDeleteSetting(msrest.serialization.Model): - """AutoDeleteSetting. - - :ivar condition: When to check if an asset is expired. Possible values include: - "CreatedGreaterThan", "LastAccessedGreaterThan". - :vartype condition: str or ~azure.mgmt.machinelearningservices.models.AutoDeleteCondition - :ivar value: Expiration condition value. - :vartype value: str - """ - - _attribute_map = { - 'condition': {'key': 'condition', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - condition: Optional[Union[str, "AutoDeleteCondition"]] = None, - value: Optional[str] = None, - **kwargs - ): - """ - :keyword condition: When to check if an asset is expired. Possible values include: - "CreatedGreaterThan", "LastAccessedGreaterThan". - :paramtype condition: str or ~azure.mgmt.machinelearningservices.models.AutoDeleteCondition - :keyword value: Expiration condition value. - :paramtype value: str - """ - super(AutoDeleteSetting, self).__init__(**kwargs) - self.condition = condition - self.value = value - - -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 AutologgerSettings(msrest.serialization.Model): - """Settings for Autologger. - - All required parameters must be populated in order to send to Azure. - - :ivar mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is enabled. - Possible values include: "Enabled", "Disabled". - :vartype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - - _validation = { - 'mlflow_autologger': {'required': True}, - } - - _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, - } - - def __init__( - self, - *, - mlflow_autologger: Union[str, "MLFlowAutologgerState"], - **kwargs - ): - """ - :keyword mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is - enabled. Possible values include: "Enabled", "Disabled". - :paramtype mlflow_autologger: str or - ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState - """ - super(AutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = mlflow_autologger - - -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, LabelingJobProperties, 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", "Labeling", "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 secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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}'}, - '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'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Labeling': 'LabelingJobProperties', '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, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = 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 secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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.secrets_configuration = secrets_configuration - 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", "Labeling", "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 secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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 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'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - '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, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = 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 secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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, secrets_configuration=secrets_configuration, 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 MonitoringAlertNotificationSettingsBase(msrest.serialization.Model): - """MonitoringAlertNotificationSettingsBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzMonMonitoringAlertNotificationSettings, EmailMonitoringAlertNotificationSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_type: Required. [Required] Specifies the type of signal to - monitor.Constant filled by server. Possible values include: "AzureMonitor", "Email". - :vartype alert_notification_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringAlertNotificationType - """ - - _validation = { - 'alert_notification_type': {'required': True}, - } - - _attribute_map = { - 'alert_notification_type': {'key': 'alertNotificationType', 'type': 'str'}, - } - - _subtype_map = { - 'alert_notification_type': {'AzureMonitor': 'AzMonMonitoringAlertNotificationSettings', 'Email': 'EmailMonitoringAlertNotificationSettings'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MonitoringAlertNotificationSettingsBase, self).__init__(**kwargs) - self.alert_notification_type = None # type: Optional[str] - - -class AzMonMonitoringAlertNotificationSettings(MonitoringAlertNotificationSettingsBase): - """AzMonMonitoringAlertNotificationSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_type: Required. [Required] Specifies the type of signal to - monitor.Constant filled by server. Possible values include: "AzureMonitor", "Email". - :vartype alert_notification_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringAlertNotificationType - """ - - _validation = { - 'alert_notification_type': {'required': True}, - } - - _attribute_map = { - 'alert_notification_type': {'key': 'alertNotificationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AzMonMonitoringAlertNotificationSettings, self).__init__(**kwargs) - self.alert_notification_type = 'AzureMonitor' # 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, HdfsDatastore, 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", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - } - - _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'Hdfs': 'HdfsDatastore', 'OneLake': 'OneLakeDatastore'} - } - - def __init__( - self, - *, - credentials: "DatastoreCredentials", - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - intellectual_property: Optional["IntellectualProperty"] = 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 intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - """ - super(DatastoreProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) - self.credentials = credentials - self.datastore_type = 'DatastoreProperties' # type: str - self.intellectual_property = intellectual_property - 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", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - '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, - intellectual_property: Optional["IntellectualProperty"] = 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 intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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, intellectual_property=intellectual_property, 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.intellectual_property = intellectual_property - 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", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - '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, - intellectual_property: Optional["IntellectualProperty"] = 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 intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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, intellectual_property=intellectual_property, 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.intellectual_property = intellectual_property - 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", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - '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, - intellectual_property: Optional["IntellectualProperty"] = 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 intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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, intellectual_property=intellectual_property, 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.intellectual_property = intellectual_property - 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", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - '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, - intellectual_property: Optional["IntellectualProperty"] = 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 intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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, intellectual_property=intellectual_property, 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.intellectual_property = intellectual_property - self.is_default = None - - -class InferencingServer(msrest.serialization.Model): - """InferencingServer. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureMLBatchInferencingServer, AzureMLOnlineInferencingServer, CustomInferencingServer, TritonInferencingServer. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - } - - _subtype_map = { - 'server_type': {'AzureMLBatch': 'AzureMLBatchInferencingServer', 'AzureMLOnline': 'AzureMLOnlineInferencingServer', 'Custom': 'CustomInferencingServer', 'Triton': 'TritonInferencingServer'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(InferencingServer, self).__init__(**kwargs) - self.server_type = None # type: Optional[str] - - -class AzureMLBatchInferencingServer(InferencingServer): - """Azure ML batch inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML batch inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML batch inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLBatchInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLBatch' # type: str - self.code_configuration = code_configuration - - -class AzureMLOnlineInferencingServer(InferencingServer): - """Azure ML online inferencing configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar code_configuration: Code configuration for AML inferencing server. - :vartype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - } - - def __init__( - self, - *, - code_configuration: Optional["CodeConfiguration"] = None, - **kwargs - ): - """ - :keyword code_configuration: Code configuration for AML inferencing server. - :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration - """ - super(AzureMLOnlineInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLOnline' # type: str - self.code_configuration = code_configuration - - -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 BaseEnvironmentSource(msrest.serialization.Model): - """BaseEnvironmentSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BaseEnvironmentId. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - } - - _subtype_map = { - 'base_environment_source_type': {'EnvironmentAsset': 'BaseEnvironmentId'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(BaseEnvironmentSource, self).__init__(**kwargs) - self.base_environment_source_type = None # type: Optional[str] - - -class BaseEnvironmentId(BaseEnvironmentSource): - """Base environment type. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source_type: Required. [Required] Base environment type.Constant filled - by server. Possible values include: "EnvironmentAsset". - :vartype base_environment_source_type: str or - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSourceType - :ivar resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :vartype resource_id: str - """ - - _validation = { - 'base_environment_source_type': {'required': True}, - 'resource_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_id: str, - **kwargs - ): - """ - :keyword resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. - :paramtype resource_id: str - """ - super(BaseEnvironmentId, self).__init__(**kwargs) - self.base_environment_source_type = 'EnvironmentAsset' # type: str - self.resource_id = resource_id - - -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 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 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 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 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 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", "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, '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", "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 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, 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.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - 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 ModelPerformanceMetricThresholdBase(msrest.serialization.Model): - """ModelPerformanceMetricThresholdBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ClassificationModelPerformanceMetricThreshold, RegressionModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :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 = { - 'model_type': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - } - - _subtype_map = { - 'model_type': {'Classification': 'ClassificationModelPerformanceMetricThreshold', 'Regression': 'RegressionModelPerformanceMetricThreshold'} - } - - 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(ModelPerformanceMetricThresholdBase, self).__init__(**kwargs) - self.model_type = None # type: Optional[str] - self.threshold = threshold - - -class ClassificationModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): - """ClassificationModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :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 classification model performance to calculate. Possible - values include: "Accuracy", "Precision", "Recall". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationModelPerformanceMetric - """ - - _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "ClassificationModelPerformanceMetric"], - 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 classification model performance to calculate. - Possible values include: "Accuracy", "Precision", "Recall". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationModelPerformanceMetric - """ - super(ClassificationModelPerformanceMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.model_type = 'Classification' # type: str - self.metric = metric - - -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 - :ivar training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - - _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'}, - 'training_mode': {'key': 'trainingMode', '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, - training_mode: Optional[Union[str, "TrainingMode"]] = 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - """ - 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 - self.training_mode = training_mode - - -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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - '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, - training_mode: Optional[Union[str, "TrainingMode"]] = 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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, training_mode=training_mode, **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 ExportSummary(msrest.serialization.Model): - """ExportSummary. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CsvExportSummary, CocoExportSummary, DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - } - - _subtype_map = { - 'format': {'CSV': 'CsvExportSummary', 'Coco': 'CocoExportSummary', 'Dataset': 'DatasetExportSummary'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ExportSummary, self).__init__(**kwargs) - self.end_date_time = None - self.exported_row_count = None - self.format = None # type: Optional[str] - self.labeling_job_id = None - self.start_date_time = None - - -class CocoExportSummary(ExportSummary): - """CocoExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CocoExportSummary, self).__init__(**kwargs) - self.format = 'Coco' # type: str - self.container_name = None - self.snapshot_path = 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, - *, - 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(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.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(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.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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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, - auto_delete_setting: Optional["AutoDeleteSetting"] = 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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, auto_delete_setting=auto_delete_setting, 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 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", "Labeling", "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 secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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 autologger_settings: Distribution configuration of the job. If set, this should be one of - Mpi, Tensorflow, PyTorch, or null. - :vartype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :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, Ray, 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'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'AutologgerSettings'}, - '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, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - autologger_settings: Optional["AutologgerSettings"] = 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 secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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 autologger_settings: Distribution configuration of the job. If set, this should be one - of Mpi, Tensorflow, PyTorch, or null. - :paramtype autologger_settings: ~azure.mgmt.machinelearningservices.models.AutologgerSettings - :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, Ray, 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, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Command' # type: str - self.autologger_settings = autologger_settings - 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(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.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(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.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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 - :ivar stage: Stage in the component lifecycle. - :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}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - '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, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - component_spec: Optional[Any] = 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword component_spec: Defines Component definition details. - - - .. raw:: html - - . - :paramtype component_spec: any - :keyword stage: Stage in the component lifecycle. - :paramtype stage: str - """ - super(ComponentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.component_spec = component_spec - self.provisioning_state = None - self.stage = stage - - -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 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'}, - '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, - 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 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.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", "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 - :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", "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 - :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", "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 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'}, - '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", - 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] = True, - **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 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.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 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.TriggerType - :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, "TriggerType"]] = 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.TriggerType - :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 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, ImportDataAction, 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", "ImportData", - "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', 'ImportData': 'ImportDataAction', '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", "ImportData", - "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 CsvExportSummary(ExportSummary): - """CsvExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar container_name: The container name to which the labels will be exported. - :vartype container_name: str - :ivar snapshot_path: The output path where the labels will be exported. - :vartype snapshot_path: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(CsvExportSummary, self).__init__(**kwargs) - self.format = 'CSV' # type: str - self.container_name = None - self.snapshot_path = None - - -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 CustomInferencingServer(InferencingServer): - """Custom inference server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for custom inferencing. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - *, - inference_configuration: Optional["OnlineInferenceConfiguration"] = None, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for custom inferencing. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(CustomInferencingServer, self).__init__(**kwargs) - self.server_type = 'Custom' # type: str - self.inference_configuration = inference_configuration - - -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. - - 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", "AccessKey", "ApiKey", "CustomKeys". - :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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: Custom Keys credential object. - :vartype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'CustomKeys'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - metadata: Optional[Any] = None, - target: Optional[str] = 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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: Custom Keys credential object. - :paramtype credentials: ~azure.mgmt.machinelearningservices.models.CustomKeys - """ - super(CustomKeysWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, metadata=metadata, target=target, **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 asset_name: Output Asset Name. - :vartype asset_name: str - :ivar asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = 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 asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - 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, GenerationSafetyQualityMonitoringSignal, GenerationTokenStatisticsSignal, ModelPerformanceSignal, PredictionDriftMonitoringSignal. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :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", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - """ - - _validation = { - 'signal_type': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', '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', 'GenerationSafetyQuality': 'GenerationSafetyQualityMonitoringSignal', 'GenerationTokenStatistics': 'GenerationTokenStatisticsSignal', 'ModelPerformance': 'ModelPerformanceSignal', 'PredictionDrift': 'PredictionDriftMonitoringSignal'} - } - - def __init__( - self, - *, - mode: Optional[Union[str, "MonitoringNotificationMode"]] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - """ - super(MonitoringSignalBase, self).__init__(**kwargs) - self.mode = mode - 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 mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :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", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar component_id: Required. [Required] ARM resource ID of the component resource 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] - :ivar workspace_connection: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype workspace_connection: - ~azure.mgmt.machinelearningservices.models.MonitoringWorkspaceConnection - """ - - _validation = { - 'signal_type': {'required': True}, - 'component_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'metric_thresholds': {'required': True}, - 'workspace_connection': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', '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]'}, - 'workspace_connection': {'key': 'workspaceConnection', 'type': 'MonitoringWorkspaceConnection'}, - } - - def __init__( - self, - *, - component_id: str, - metric_thresholds: List["CustomMetricThreshold"], - workspace_connection: "MonitoringWorkspaceConnection", - mode: Optional[Union[str, "MonitoringNotificationMode"]] = None, - properties: Optional[Dict[str, str]] = None, - input_assets: Optional[Dict[str, "MonitoringInputDataBase"]] = None, - inputs: Optional[Dict[str, "JobInput"]] = None, - **kwargs - ): - """ - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword component_id: Required. [Required] ARM resource ID of the component resource 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] - :keyword workspace_connection: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype workspace_connection: - ~azure.mgmt.machinelearningservices.models.MonitoringWorkspaceConnection - """ - super(CustomMonitoringSignal, self).__init__(mode=mode, 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 - self.workspace_connection = workspace_connection - - -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] - """ - - _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]'}, - } - - 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, - **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] - """ - 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 - - -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 DataImportSource(msrest.serialization.Model): - """DataImportSource. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DatabaseSource, FileSystemSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - } - - _subtype_map = { - 'source_type': {'database': 'DatabaseSource', 'file_system': 'FileSystemSource'} - } - - def __init__( - self, - *, - connection: Optional[str] = None, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - """ - super(DataImportSource, self).__init__(**kwargs) - self.connection = connection - self.source_type = None # type: Optional[str] - - -class DatabaseSource(DataImportSource): - """DatabaseSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - :ivar query: SQL Query statement for data import Database source. - :vartype query: str - :ivar stored_procedure: SQL StoredProcedure on data import Database source. - :vartype stored_procedure: str - :ivar stored_procedure_params: SQL StoredProcedure parameters. - :vartype stored_procedure_params: list[dict[str, str]] - :ivar table_name: Name of the table on data import Database source. - :vartype table_name: str - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'query': {'key': 'query', 'type': 'str'}, - 'stored_procedure': {'key': 'storedProcedure', 'type': 'str'}, - 'stored_procedure_params': {'key': 'storedProcedureParams', 'type': '[{str}]'}, - 'table_name': {'key': 'tableName', 'type': 'str'}, - } - - def __init__( - self, - *, - connection: Optional[str] = None, - query: Optional[str] = None, - stored_procedure: Optional[str] = None, - stored_procedure_params: Optional[List[Dict[str, str]]] = None, - table_name: Optional[str] = None, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - :keyword query: SQL Query statement for data import Database source. - :paramtype query: str - :keyword stored_procedure: SQL StoredProcedure on data import Database source. - :paramtype stored_procedure: str - :keyword stored_procedure_params: SQL StoredProcedure parameters. - :paramtype stored_procedure_params: list[dict[str, str]] - :keyword table_name: Name of the table on data import Database source. - :paramtype table_name: str - """ - super(DatabaseSource, self).__init__(connection=connection, **kwargs) - self.source_type = 'database' # type: str - self.query = query - self.stored_procedure = stored_procedure - self.stored_procedure_params = stored_procedure_params - self.table_name = table_name - - -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(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.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 mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :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", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar data_segment: The data segment used for scoping on a subset of the data population. - :vartype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :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 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 = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - '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", - mode: Optional[Union[str, "MonitoringNotificationMode"]] = None, - properties: Optional[Dict[str, str]] = None, - data_segment: Optional["MonitoringDataSegment"] = None, - feature_data_type_override: Optional[Dict[str, Union[str, "MonitoringFeatureDataType"]]] = None, - features: Optional["MonitoringFeatureFilterBase"] = None, - **kwargs - ): - """ - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword data_segment: The data segment used for scoping on a subset of the data population. - :paramtype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :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 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__(mode=mode, properties=properties, **kwargs) - self.signal_type = 'DataDrift' # type: str - self.data_segment = data_segment - self.feature_data_type_override = feature_data_type_override - 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 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: 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}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', '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, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(DataVersionBaseProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str - self.data_uri = data_uri - self.intellectual_property = intellectual_property - self.stage = stage - - -class DataImport(DataVersionBaseProperties): - """DataImport. - - 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: str - :ivar asset_name: Name of the asset for data import job to create. - :vartype asset_name: str - :ivar source: Source data of the asset to import from. - :vartype source: ~azure.mgmt.machinelearningservices.models.DataImportSource - """ - - _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}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'DataImportSource'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - stage: Optional[str] = None, - asset_name: Optional[str] = None, - source: Optional["DataImportSource"] = 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - :keyword asset_name: Name of the asset for data import job to create. - :paramtype asset_name: str - :keyword source: Source data of the asset to import from. - :paramtype source: ~azure.mgmt.machinelearningservices.models.DataImportSource - """ - super(DataImport, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **kwargs) - self.data_type = 'uri_folder' # type: str - self.asset_name = asset_name - self.source = source - - -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 mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :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", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :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 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 = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'feature_data_type_override': {'key': 'featureDataTypeOverride', 'type': '{str}'}, - '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", - mode: Optional[Union[str, "MonitoringNotificationMode"]] = None, - properties: Optional[Dict[str, str]] = None, - feature_data_type_override: Optional[Dict[str, Union[str, "MonitoringFeatureDataType"]]] = None, - features: Optional["MonitoringFeatureFilterBase"] = None, - **kwargs - ): - """ - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :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 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__(mode=mode, properties=properties, **kwargs) - self.signal_type = 'DataQuality' # type: str - self.feature_data_type_override = feature_data_type_override - self.features = features - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.reference_data = reference_data - - -class DatasetExportSummary(ExportSummary): - """DatasetExportSummary. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar end_date_time: The time when the export was completed. - :vartype end_date_time: ~datetime.datetime - :ivar exported_row_count: The total number of labeled datapoints exported. - :vartype exported_row_count: long - :ivar format: Required. [Required] The format of exported labels, also as the - discriminator.Constant filled by server. Possible values include: "Dataset", "Coco", "CSV". - :vartype format: str or ~azure.mgmt.machinelearningservices.models.ExportFormatType - :ivar labeling_job_id: Name and identifier of the job containing exported labels. - :vartype labeling_job_id: str - :ivar start_date_time: The time when the export was requested. - :vartype start_date_time: ~datetime.datetime - :ivar labeled_asset_name: The unique name of the labeled data asset. - :vartype labeled_asset_name: str - """ - - _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'labeled_asset_name': {'readonly': True}, - } - - _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'labeled_asset_name': {'key': 'labeledAssetName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DatasetExportSummary, self).__init__(**kwargs) - self.format = 'Dataset' # type: str - self.labeled_asset_name = None - - -class Datastore(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.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(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.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 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", "ModelDataCollector". - :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", "ModelDataCollector". - :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 locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - locations: Optional[List[str]] = None, - max_instance_count: Optional[int] = 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 locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :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.locations = locations - self.max_instance_count = max_instance_count - 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 locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :ivar properties: Additional properties bag. - :vartype properties: dict[str, any] - """ - - _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - *, - instance_count: Optional[int] = 1, - instance_type: Optional[str] = None, - locations: Optional[List[str]] = None, - max_instance_count: Optional[int] = 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 locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :keyword properties: Additional properties bag. - :paramtype properties: dict[str, any] - """ - super(DeploymentResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, locations=locations, max_instance_count=max_instance_count, properties=properties, **kwargs) - - -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 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}'}, - '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, - 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 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.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, Ray, 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", - "Ray". - :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', 'Ray': 'Ray', '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 EmailMonitoringAlertNotificationSettings(MonitoringAlertNotificationSettingsBase): - """EmailMonitoringAlertNotificationSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar alert_notification_type: Required. [Required] Specifies the type of signal to - monitor.Constant filled by server. Possible values include: "AzureMonitor", "Email". - :vartype alert_notification_type: str or - ~azure.mgmt.machinelearningservices.models.MonitoringAlertNotificationType - :ivar email_notification_setting: Configuration for notification. - :vartype email_notification_setting: - ~azure.mgmt.machinelearningservices.models.NotificationSetting - """ - - _validation = { - 'alert_notification_type': {'required': True}, - } - - _attribute_map = { - 'alert_notification_type': {'key': 'alertNotificationType', 'type': 'str'}, - 'email_notification_setting': {'key': 'emailNotificationSetting', 'type': 'NotificationSetting'}, - } - - def __init__( - self, - *, - email_notification_setting: Optional["NotificationSetting"] = None, - **kwargs - ): - """ - :keyword email_notification_setting: Configuration for notification. - :paramtype email_notification_setting: - ~azure.mgmt.machinelearningservices.models.NotificationSetting - """ - super(EmailMonitoringAlertNotificationSettings, self).__init__(**kwargs) - self.alert_notification_type = 'Email' # type: str - self.email_notification_setting = email_notification_setting - - -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 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", "ImportData", - "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(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.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(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.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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - '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, - auto_delete_setting: Optional["AutoDeleteSetting"] = 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, - intellectual_property: Optional["IntellectualProperty"] = 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if environment is an - Intellectual Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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, auto_delete_setting=auto_delete_setting, 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.intellectual_property = intellectual_property - 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(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.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 mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :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", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :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}, - 'metric_threshold': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'FeatureAttributionMetricThreshold'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - metric_threshold: "FeatureAttributionMetricThreshold", - production_data: List["MonitoringInputDataBase"], - reference_data: "MonitoringInputDataBase", - mode: Optional[Union[str, "MonitoringNotificationMode"]] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :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__(mode=mode, properties=properties, **kwargs) - self.signal_type = 'FeatureAttributionDrift' # type: str - 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 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(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.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 FeaturesetJob(msrest.serialization.Model): - """Dto object representing the feature set job. - - :ivar created_date: Specifies the created date. - :vartype created_date: ~datetime.datetime - :ivar display_name: Specifies the display name. - :vartype display_name: str - :ivar duration: Specifies the duration. - :vartype duration: ~datetime.timedelta - :ivar experiment_id: Specifies the experiment id. - :vartype experiment_id: str - :ivar feature_window: Specifies the backfill feature window to be materialized. - :vartype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :ivar job_id: Specifies the job id. - :vartype job_id: str - :ivar status: Specifies the job status. 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 tags: A set of tags. Specifies the tags if any. - :vartype tags: dict[str, str] - :ivar type: Specifies the feature store job type. Possible values include: - "RecurrentMaterialization", "BackfillMaterialization". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.FeaturestoreJobType - """ - - _attribute_map = { - 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'duration': {'key': 'duration', 'type': 'duration'}, - 'experiment_id': {'key': 'experimentId', 'type': 'str'}, - 'feature_window': {'key': 'featureWindow', 'type': 'FeatureWindow'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - *, - created_date: Optional[datetime.datetime] = None, - display_name: Optional[str] = None, - duration: Optional[datetime.timedelta] = None, - experiment_id: Optional[str] = None, - feature_window: Optional["FeatureWindow"] = None, - job_id: Optional[str] = None, - status: Optional[Union[str, "JobStatus"]] = None, - tags: Optional[Dict[str, str]] = None, - type: Optional[Union[str, "FeaturestoreJobType"]] = None, - **kwargs - ): - """ - :keyword created_date: Specifies the created date. - :paramtype created_date: ~datetime.datetime - :keyword display_name: Specifies the display name. - :paramtype display_name: str - :keyword duration: Specifies the duration. - :paramtype duration: ~datetime.timedelta - :keyword experiment_id: Specifies the experiment id. - :paramtype experiment_id: str - :keyword feature_window: Specifies the backfill feature window to be materialized. - :paramtype feature_window: ~azure.mgmt.machinelearningservices.models.FeatureWindow - :keyword job_id: Specifies the job id. - :paramtype job_id: str - :keyword status: Specifies the job status. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :paramtype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :keyword tags: A set of tags. Specifies the tags if any. - :paramtype tags: dict[str, str] - :keyword type: Specifies the feature store job type. Possible values include: - "RecurrentMaterialization", "BackfillMaterialization". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.FeaturestoreJobType - """ - super(FeaturesetJob, self).__init__(**kwargs) - self.created_date = created_date - self.display_name = display_name - self.duration = duration - self.experiment_id = experiment_id - self.feature_window = feature_window - self.job_id = job_id - self.status = status - self.tags = tags - self.type = type - - -class FeaturesetJobArmPaginatedResult(msrest.serialization.Model): - """A paginated list of FeaturesetJob entities. - - :ivar next_link: The link to the next page of FeaturesetJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type FeaturesetJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetJob] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetJob]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["FeaturesetJob"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of FeaturesetJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type FeaturesetJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetJob] - """ - super(FeaturesetJobArmPaginatedResult, 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(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.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 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 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 = { - 'description': {'key': 'description', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'feature_window': {'key': 'featureWindow', 'type': 'FeatureWindow'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - display_name: Optional[str] = None, - feature_window: Optional["FeatureWindow"] = None, - resource: Optional["MaterializationComputeResource"] = None, - spark_configuration: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :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 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.description = description - self.display_name = display_name - self.feature_window = feature_window - self.resource = resource - self.spark_configuration = spark_configuration - self.tags = tags - - -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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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, - auto_delete_setting: Optional["AutoDeleteSetting"] = 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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, auto_delete_setting=auto_delete_setting, 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(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.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(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.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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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, - auto_delete_setting: Optional["AutoDeleteSetting"] = 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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, auto_delete_setting=auto_delete_setting, 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 FileSystemSource(DataImportSource): - """FileSystemSource. - - All required parameters must be populated in order to send to Azure. - - :ivar connection: Workspace connection for data import source storage. - :vartype connection: str - :ivar source_type: Required. [Required] Specifies the type of data.Constant filled by server. - Possible values include: "database", "file_system". - :vartype source_type: str or ~azure.mgmt.machinelearningservices.models.DataImportSourceType - :ivar path: Path on data import FileSystem source. - :vartype path: str - """ - - _validation = { - 'source_type': {'required': True}, - } - - _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - connection: Optional[str] = None, - path: Optional[str] = None, - **kwargs - ): - """ - :keyword connection: Workspace connection for data import source storage. - :paramtype connection: str - :keyword path: Path on data import FileSystem source. - :paramtype path: str - """ - super(FileSystemSource, self).__init__(connection=connection, **kwargs) - self.source_type = 'file_system' # type: str - self.path = path - - -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, StaticInputData, TrailingInputData. - - 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", "Trailing", "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', 'Static': 'StaticInputData', 'Trailing': 'TrailingInputData'} - } - - 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", "Trailing", "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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, 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.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - 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 features_unknown_at_forecast_time: The feature columns that are available for training - but unknown at the time of forecast/inference. - If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in - the dataset are known at inference time. - :vartype features_unknown_at_forecast_time: list[str] - :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'}, - 'features_unknown_at_forecast_time': {'key': 'featuresUnknownAtForecastTime', '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, - features_unknown_at_forecast_time: Optional[List[str]] = 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 features_unknown_at_forecast_time: The feature columns that are available for training - but unknown at the time of forecast/inference. - If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in - the dataset are known at inference time. - :paramtype features_unknown_at_forecast_time: list[str] - :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.features_unknown_at_forecast_time = features_unknown_at_forecast_time - 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - '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, - training_mode: Optional[Union[str, "TrainingMode"]] = 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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, training_mode=training_mode, **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. - - 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". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :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 = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', '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". - :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.status = status - self.type = None # type: Optional[str] - - -class FqdnOutboundRule(OutboundRule): - """FQDN Outbound Rule for the managed network of a machine learning workspace. - - 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". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :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 = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', '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". - :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 GenerationSafetyQualityMetricThreshold(msrest.serialization.Model): - """Generation safety quality metric threshold definition. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "AcceptableGroundednessScorePerInstance", - "AggregatedGroundednessPassRate", "AcceptableCoherenceScorePerInstance", - "AggregatedCoherencePassRate", "AcceptableFluencyScorePerInstance", - "AggregatedFluencyPassRate", "AcceptableSimilarityScorePerInstance", - "AggregatedSimilarityPassRate", "AcceptableRelevanceScorePerInstance", - "AggregatedRelevancePassRate". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetric - :ivar threshold: Gets or sets 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, "GenerationSafetyQualityMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "AcceptableGroundednessScorePerInstance", - "AggregatedGroundednessPassRate", "AcceptableCoherenceScorePerInstance", - "AggregatedCoherencePassRate", "AcceptableFluencyScorePerInstance", - "AggregatedFluencyPassRate", "AcceptableSimilarityScorePerInstance", - "AggregatedSimilarityPassRate", "AcceptableRelevanceScorePerInstance", - "AggregatedRelevancePassRate". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetric - :keyword threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(GenerationSafetyQualityMetricThreshold, self).__init__(**kwargs) - self.metric = metric - self.threshold = threshold - - -class GenerationSafetyQualityMonitoringSignal(MonitoringSignalBase): - """Generation safety quality monitoring signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :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", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetricThreshold] - :ivar production_data: Gets or sets the target data for computing metrics. - :vartype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :ivar sampling_rate: Required. [Required] The sample rate of the target data, should be greater - than 0 and at most 1. - :vartype sampling_rate: float - :ivar workspace_connection_id: Gets or sets the workspace connection ID used to connect to the - content generation endpoint. - :vartype workspace_connection_id: str - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'sampling_rate': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[GenerationSafetyQualityMetricThreshold]'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - 'workspace_connection_id': {'key': 'workspaceConnectionId', 'type': 'str'}, - } - - def __init__( - self, - *, - metric_thresholds: List["GenerationSafetyQualityMetricThreshold"], - sampling_rate: float, - mode: Optional[Union[str, "MonitoringNotificationMode"]] = None, - properties: Optional[Dict[str, str]] = None, - production_data: Optional[List["MonitoringInputDataBase"]] = None, - workspace_connection_id: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationSafetyQualityMetricThreshold] - :keyword production_data: Gets or sets the target data for computing metrics. - :paramtype production_data: - list[~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase] - :keyword sampling_rate: Required. [Required] The sample rate of the target data, should be - greater than 0 and at most 1. - :paramtype sampling_rate: float - :keyword workspace_connection_id: Gets or sets the workspace connection ID used to connect to - the content generation endpoint. - :paramtype workspace_connection_id: str - """ - super(GenerationSafetyQualityMonitoringSignal, self).__init__(mode=mode, properties=properties, **kwargs) - self.signal_type = 'GenerationSafetyQuality' # type: str - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.sampling_rate = sampling_rate - self.workspace_connection_id = workspace_connection_id - - -class GenerationTokenStatisticsMetricThreshold(msrest.serialization.Model): - """Generation token statistics metric threshold definition. - - All required parameters must be populated in order to send to Azure. - - :ivar metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "TotalTokenCount", "TotalTokenCountPerGroup". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.GenerationTokenStatisticsMetric - :ivar threshold: Gets or sets 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, "GenerationTokenStatisticsMetric"], - threshold: Optional["MonitoringThreshold"] = None, - **kwargs - ): - """ - :keyword metric: Required. [Required] Gets or sets the feature attribution metric to calculate. - Possible values include: "TotalTokenCount", "TotalTokenCountPerGroup". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.GenerationTokenStatisticsMetric - :keyword threshold: Gets or sets the threshold value. - If null, a default value will be set depending on the selected metric. - :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold - """ - super(GenerationTokenStatisticsMetricThreshold, self).__init__(**kwargs) - self.metric = metric - self.threshold = threshold - - -class GenerationTokenStatisticsSignal(MonitoringSignalBase): - """Generation token statistics signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :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", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :vartype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationTokenStatisticsMetricThreshold] - :ivar production_data: Gets or sets the target data for computing metrics. - :vartype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :ivar sampling_rate: Required. [Required] The sample rate of the target data, should be greater - than 0 and at most 1. - :vartype sampling_rate: float - """ - - _validation = { - 'signal_type': {'required': True}, - 'metric_thresholds': {'required': True}, - 'sampling_rate': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[GenerationTokenStatisticsMetricThreshold]'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, - } - - def __init__( - self, - *, - metric_thresholds: List["GenerationTokenStatisticsMetricThreshold"], - sampling_rate: float, - mode: Optional[Union[str, "MonitoringNotificationMode"]] = None, - properties: Optional[Dict[str, str]] = None, - production_data: Optional["MonitoringInputDataBase"] = None, - **kwargs - ): - """ - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword metric_thresholds: Required. [Required] Gets or sets the metrics to calculate and the - corresponding thresholds. - :paramtype metric_thresholds: - list[~azure.mgmt.machinelearningservices.models.GenerationTokenStatisticsMetricThreshold] - :keyword production_data: Gets or sets the target data for computing metrics. - :paramtype production_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputDataBase - :keyword sampling_rate: Required. [Required] The sample rate of the target data, should be - greater than 0 and at most 1. - :paramtype sampling_rate: float - """ - super(GenerationTokenStatisticsSignal, self).__init__(mode=mode, properties=properties, **kwargs) - self.signal_type = 'GenerationTokenStatistics' # type: str - self.metric_thresholds = metric_thresholds - self.production_data = production_data - self.sampling_rate = sampling_rate - - -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(DatastoreProperties): - """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", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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, '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'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - '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, - intellectual_property: Optional["IntellectualProperty"] = 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 intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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, intellectual_property=intellectual_property, **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 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 images. Possible values include: "docker", "azureml". Default value: "docker". - :vartype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :ivar reference: Image reference URL. - :vartype reference: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - type: Optional[Union[str, "ImageType"]] = "docker", - reference: 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 images. Possible values include: "docker", "azureml". Default value: "docker". - :paramtype type: str or ~azure.mgmt.machinelearningservices.models.ImageType - :keyword reference: Image reference URL. - :paramtype reference: str - """ - super(Image, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.type = type - self.reference = reference - - -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. - - :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 - """ - - _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'}, - } - - 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 - - -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 log_training_metrics: Enable computing and logging training metrics. Possible values - include: "Enable", "Disable". - :vartype log_training_metrics: str or - ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics - :ivar log_validation_loss: Enable computing and logging validation loss. Possible values - include: "Enable", "Disable". - :vartype log_validation_loss: str or - ~azure.mgmt.machinelearningservices.models.LogValidationLoss - :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'}, - 'log_training_metrics': {'key': 'logTrainingMetrics', 'type': 'str'}, - 'log_validation_loss': {'key': 'logValidationLoss', 'type': 'str'}, - '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, - log_training_metrics: Optional[Union[str, "LogTrainingMetrics"]] = None, - log_validation_loss: Optional[Union[str, "LogValidationLoss"]] = 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 log_training_metrics: Enable computing and logging training metrics. Possible values - include: "Enable", "Disable". - :paramtype log_training_metrics: str or - ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics - :keyword log_validation_loss: Enable computing and logging validation loss. Possible values - include: "Enable", "Disable". - :paramtype log_validation_loss: str or - ~azure.mgmt.machinelearningservices.models.LogValidationLoss - :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.log_training_metrics = log_training_metrics - self.log_validation_loss = log_validation_loss - 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 ImportDataAction(ScheduleActionBase): - """ImportDataAction. - - 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", "ImportData", - "CreateMonitor". - :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType - :ivar data_import_definition: Required. [Required] Defines Schedule action definition details. - :vartype data_import_definition: ~azure.mgmt.machinelearningservices.models.DataImport - """ - - _validation = { - 'action_type': {'required': True}, - 'data_import_definition': {'required': True}, - } - - _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'data_import_definition': {'key': 'dataImportDefinition', 'type': 'DataImport'}, - } - - def __init__( - self, - *, - data_import_definition: "DataImport", - **kwargs - ): - """ - :keyword data_import_definition: Required. [Required] Defines Schedule action definition - details. - :paramtype data_import_definition: ~azure.mgmt.machinelearningservices.models.DataImport - """ - super(ImportDataAction, self).__init__(**kwargs) - self.action_type = 'ImportData' # type: str - self.data_import_definition = data_import_definition - - -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 IntellectualProperty(msrest.serialization.Model): - """Intellectual Property details for a resource. - - All required parameters must be populated in order to send to Azure. - - :ivar protection_level: Protection level of the Intellectual Property. Possible values include: - "All", "None". - :vartype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :ivar publisher: Required. [Required] Publisher of the Intellectual Property. Must be the same - as Registry publisher name. - :vartype publisher: str - """ - - _validation = { - 'publisher': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'protection_level': {'key': 'protectionLevel', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - } - - def __init__( - self, - *, - publisher: str, - protection_level: Optional[Union[str, "ProtectionLevel"]] = None, - **kwargs - ): - """ - :keyword protection_level: Protection level of the Intellectual Property. Possible values - include: "All", "None". - :paramtype protection_level: str or ~azure.mgmt.machinelearningservices.models.ProtectionLevel - :keyword publisher: Required. [Required] Publisher of the Intellectual Property. Must be the - same as Registry publisher name. - :paramtype publisher: str - """ - super(IntellectualProperty, self).__init__(**kwargs) - self.protection_level = protection_level - self.publisher = publisher - - -class JobBase(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.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 locations: Locations where the job can run. - :vartype locations: list[str] - :ivar max_instance_count: Optional max allowed number of instances or nodes to be used by the - compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :vartype max_instance_count: int - :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'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - '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, - locations: Optional[List[str]] = None, - max_instance_count: Optional[int] = 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 locations: Locations where the job can run. - :paramtype locations: list[str] - :keyword max_instance_count: Optional max allowed number of instances or nodes to be used by - the compute target. - For use with elastic training, currently supported by PyTorch distribution type only. - :paramtype max_instance_count: int - :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, locations=locations, max_instance_count=max_instance_count, 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", "ImportData", - "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 set by user. - :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 set by user. - :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 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, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, '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, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, '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 - - -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, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, '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 - - -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 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 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 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 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 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 LabelCategory(msrest.serialization.Model): - """Label category definition. - - :ivar classes: Dictionary of label classes in this category. - :vartype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :ivar display_name: Display name of the label category. - :vartype display_name: str - :ivar multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :vartype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - - _attribute_map = { - 'classes': {'key': 'classes', 'type': '{LabelClass}'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'multi_select': {'key': 'multiSelect', 'type': 'str'}, - } - - def __init__( - self, - *, - classes: Optional[Dict[str, "LabelClass"]] = None, - display_name: Optional[str] = None, - multi_select: Optional[Union[str, "MultiSelect"]] = None, - **kwargs - ): - """ - :keyword classes: Dictionary of label classes in this category. - :paramtype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - :keyword display_name: Display name of the label category. - :paramtype display_name: str - :keyword multi_select: Indicates whether it is allowed to select multiple classes in this - category. Possible values include: "Enabled", "Disabled". - :paramtype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect - """ - super(LabelCategory, self).__init__(**kwargs) - self.classes = classes - self.display_name = display_name - self.multi_select = multi_select - - -class LabelClass(msrest.serialization.Model): - """Label class definition. - - :ivar display_name: Display name of the label class. - :vartype display_name: str - :ivar subclasses: Dictionary of subclasses of the label class. - :vartype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, - } - - def __init__( - self, - *, - display_name: Optional[str] = None, - subclasses: Optional[Dict[str, "LabelClass"]] = None, - **kwargs - ): - """ - :keyword display_name: Display name of the label class. - :paramtype display_name: str - :keyword subclasses: Dictionary of subclasses of the label class. - :paramtype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] - """ - super(LabelClass, self).__init__(**kwargs) - self.display_name = display_name - self.subclasses = subclasses - - -class LabelingDataConfiguration(msrest.serialization.Model): - """Labeling data configuration definition. - - :ivar data_id: Resource Id of the data asset to perform labeling. - :vartype data_id: str - :ivar incremental_data_refresh: Indicates whether to enable incremental data refresh. Possible - values include: "Enabled", "Disabled". - :vartype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - - _attribute_map = { - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'incremental_data_refresh': {'key': 'incrementalDataRefresh', 'type': 'str'}, - } - - def __init__( - self, - *, - data_id: Optional[str] = None, - incremental_data_refresh: Optional[Union[str, "IncrementalDataRefresh"]] = None, - **kwargs - ): - """ - :keyword data_id: Resource Id of the data asset to perform labeling. - :paramtype data_id: str - :keyword incremental_data_refresh: Indicates whether to enable incremental data refresh. - Possible values include: "Enabled", "Disabled". - :paramtype incremental_data_refresh: str or - ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh - """ - super(LabelingDataConfiguration, self).__init__(**kwargs) - self.data_id = data_id - self.incremental_data_refresh = incremental_data_refresh - - -class LabelingJob(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.LabelingJobProperties - """ - - _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': 'LabelingJobProperties'}, - } - - def __init__( - self, - *, - properties: "LabelingJobProperties", - **kwargs - ): - """ - :keyword properties: Required. [Required] Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties - """ - super(LabelingJob, self).__init__(**kwargs) - self.properties = properties - - -class LabelingJobMediaProperties(msrest.serialization.Model): - """Properties of a labeling job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: LabelingJobImageProperties, LabelingJobTextProperties. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - } - - _subtype_map = { - 'media_type': {'Image': 'LabelingJobImageProperties', 'Text': 'LabelingJobTextProperties'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(LabelingJobMediaProperties, self).__init__(**kwargs) - self.media_type = None # type: Optional[str] - - -class LabelingJobImageProperties(LabelingJobMediaProperties): - """Properties of a labeling job for image data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - *, - annotation_type: Optional[Union[str, "ImageAnnotationType"]] = None, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of image labeling job. Possible values include: - "Classification", "BoundingBox", "InstanceSegmentation". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.ImageAnnotationType - """ - super(LabelingJobImageProperties, self).__init__(**kwargs) - self.media_type = 'Image' # type: str - self.annotation_type = annotation_type - - -class LabelingJobInstructions(msrest.serialization.Model): - """Instructions for labeling job. - - :ivar uri: The link to a page with detailed labeling instructions for labelers. - :vartype uri: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: Optional[str] = None, - **kwargs - ): - """ - :keyword uri: The link to a page with detailed labeling instructions for labelers. - :paramtype uri: str - """ - super(LabelingJobInstructions, self).__init__(**kwargs) - self.uri = uri - - -class LabelingJobProperties(JobBaseProperties): - """Labeling 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", "Labeling", "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 secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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 created_date_time: Created time of the job in UTC timezone. - :vartype created_date_time: ~datetime.datetime - :ivar data_configuration: Configuration of data used in the job. - :vartype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :ivar job_instructions: Labeling instructions of the job. - :vartype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :ivar label_categories: Label categories of the job. - :vartype label_categories: dict[str, ~azure.mgmt.machinelearningservices.models.LabelCategory] - :ivar labeling_job_media_properties: Media type specific properties in the job. - :vartype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :ivar ml_assist_configuration: Configuration of MLAssist feature in the job. - :vartype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - :ivar progress_metrics: Progress metrics of the job. - :vartype progress_metrics: ~azure.mgmt.machinelearningservices.models.ProgressMetrics - :ivar project_id: Internal id of the job(Previously called project). - :vartype project_id: str - :ivar provisioning_state: Specifies the labeling job provisioning state. Possible values - include: "Succeeded", "Failed", "Canceled", "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.JobProvisioningState - :ivar status_messages: Status messages of the job. - :vartype status_messages: list[~azure.mgmt.machinelearningservices.models.StatusMessage] - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'progress_metrics': {'readonly': True}, - 'project_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status_messages': {'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'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'data_configuration': {'key': 'dataConfiguration', 'type': 'LabelingDataConfiguration'}, - 'job_instructions': {'key': 'jobInstructions', 'type': 'LabelingJobInstructions'}, - 'label_categories': {'key': 'labelCategories', 'type': '{LabelCategory}'}, - 'labeling_job_media_properties': {'key': 'labelingJobMediaProperties', 'type': 'LabelingJobMediaProperties'}, - 'ml_assist_configuration': {'key': 'mlAssistConfiguration', 'type': 'MLAssistConfiguration'}, - 'progress_metrics': {'key': 'progressMetrics', 'type': 'ProgressMetrics'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status_messages': {'key': 'statusMessages', 'type': '[StatusMessage]'}, - } - - 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, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, - services: Optional[Dict[str, "JobService"]] = None, - data_configuration: Optional["LabelingDataConfiguration"] = None, - job_instructions: Optional["LabelingJobInstructions"] = None, - label_categories: Optional[Dict[str, "LabelCategory"]] = None, - labeling_job_media_properties: Optional["LabelingJobMediaProperties"] = None, - ml_assist_configuration: Optional["MLAssistConfiguration"] = 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 secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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_configuration: Configuration of data used in the job. - :paramtype data_configuration: - ~azure.mgmt.machinelearningservices.models.LabelingDataConfiguration - :keyword job_instructions: Labeling instructions of the job. - :paramtype job_instructions: ~azure.mgmt.machinelearningservices.models.LabelingJobInstructions - :keyword label_categories: Label categories of the job. - :paramtype label_categories: dict[str, - ~azure.mgmt.machinelearningservices.models.LabelCategory] - :keyword labeling_job_media_properties: Media type specific properties in the job. - :paramtype labeling_job_media_properties: - ~azure.mgmt.machinelearningservices.models.LabelingJobMediaProperties - :keyword ml_assist_configuration: Configuration of MLAssist feature in the job. - :paramtype ml_assist_configuration: - ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration - """ - super(LabelingJobProperties, 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, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Labeling' # type: str - self.created_date_time = None - self.data_configuration = data_configuration - self.job_instructions = job_instructions - self.label_categories = label_categories - self.labeling_job_media_properties = labeling_job_media_properties - self.ml_assist_configuration = ml_assist_configuration - self.progress_metrics = None - self.project_id = None - self.provisioning_state = None - self.status_messages = None - - -class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): - """A paginated list of LabelingJob entities. - - :ivar next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :vartype next_link: str - :ivar value: An array of objects of type LabelingJob. - :vartype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[LabelingJob]'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - value: Optional[List["LabelingJob"]] = None, - **kwargs - ): - """ - :keyword next_link: The link to the next page of LabelingJob objects. If null, there are no - additional pages. - :paramtype next_link: str - :keyword value: An array of objects of type LabelingJob. - :paramtype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] - """ - super(LabelingJobResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value - - -class LabelingJobTextProperties(LabelingJobMediaProperties): - """Properties of a labeling job for text data. - - All required parameters must be populated in order to send to Azure. - - :ivar media_type: Required. [Required] Media type of the job.Constant filled by server. - Possible values include: "Image", "Text". - :vartype media_type: str or ~azure.mgmt.machinelearningservices.models.MediaType - :ivar annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :vartype annotation_type: str or ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - - _validation = { - 'media_type': {'required': True}, - } - - _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, - } - - def __init__( - self, - *, - annotation_type: Optional[Union[str, "TextAnnotationType"]] = None, - **kwargs - ): - """ - :keyword annotation_type: Annotation type of text labeling job. Possible values include: - "Classification", "NamedEntityRecognition". - :paramtype annotation_type: str or - ~azure.mgmt.machinelearningservices.models.TextAnnotationType - """ - super(LabelingJobTextProperties, self).__init__(**kwargs) - self.media_type = 'Text' # type: str - self.annotation_type = annotation_type - - -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] Monitor compute identity type enum.Constant - filled by server. Possible values include: "AmlToken", "ManagedIdentity". - :vartype compute_identity_type: str or - ~azure.mgmt.machinelearningservices.models.MonitorComputeIdentityType - :ivar identity: Managed service identity (system assigned and/or user assigned identities). - :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: Managed service identity (system assigned and/or user assigned identities). - :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. - - 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", "AccessKey", "ApiKey", "CustomKeys". - :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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - metadata: Optional[Any] = None, - target: Optional[str] = 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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity - """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, metadata=metadata, target=target, **kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = credentials - - -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 - """ - - _validation = { - 'network_id': {'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'}, - } - - 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 - - -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 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 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 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 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 MLAssistConfiguration(msrest.serialization.Model): - """Labeling MLAssist configuration definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MLAssistConfigurationDisabled, MLAssistConfigurationEnabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - _subtype_map = { - 'ml_assist': {'Disabled': 'MLAssistConfigurationDisabled', 'Enabled': 'MLAssistConfigurationEnabled'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfiguration, self).__init__(**kwargs) - self.ml_assist = None # type: Optional[str] - - -class MLAssistConfigurationDisabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is disabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - """ - - _validation = { - 'ml_assist': {'required': True}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(MLAssistConfigurationDisabled, self).__init__(**kwargs) - self.ml_assist = 'Disabled' # type: str - - -class MLAssistConfigurationEnabled(MLAssistConfiguration): - """Labeling MLAssist configuration definition when MLAssist is enabled. - - All required parameters must be populated in order to send to Azure. - - :ivar ml_assist: Required. [Required] Indicates whether MLAssist feature is enabled.Constant - filled by server. Possible values include: "Enabled", "Disabled". - :vartype ml_assist: str or ~azure.mgmt.machinelearningservices.models.MLAssistConfigurationType - :ivar inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :vartype inferencing_compute_binding: str - :ivar training_compute_binding: Required. [Required] AML compute binding used in training. - :vartype training_compute_binding: str - """ - - _validation = { - 'ml_assist': {'required': True}, - 'inferencing_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - 'inferencing_compute_binding': {'key': 'inferencingComputeBinding', 'type': 'str'}, - 'training_compute_binding': {'key': 'trainingComputeBinding', 'type': 'str'}, - } - - def __init__( - self, - *, - inferencing_compute_binding: str, - training_compute_binding: str, - **kwargs - ): - """ - :keyword inferencing_compute_binding: Required. [Required] AML compute binding used in - inferencing. - :paramtype inferencing_compute_binding: str - :keyword training_compute_binding: Required. [Required] AML compute binding used in training. - :paramtype training_compute_binding: str - """ - super(MLAssistConfigurationEnabled, self).__init__(**kwargs) - self.ml_assist = 'Enabled' # type: str - self.inferencing_compute_binding = inferencing_compute_binding - self.training_compute_binding = training_compute_binding - - -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 asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = 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 asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: 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}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', '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, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = None, - stage: Optional[str] = None, - 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: 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, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **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 asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = 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 asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - self.mode = mode - self.uri = uri - self.job_output_type = 'mltable' # type: str - self.description = description - - -class ModelConfiguration(msrest.serialization.Model): - """Model configuration options. - - :ivar mode: Input delivery mode for the model. Possible values include: "Copy", "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mounting path of the model in the target image. - :vartype mount_path: str - """ - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "PackageInputDeliveryMode"]] = None, - mount_path: Optional[str] = None, - **kwargs - ): - """ - :keyword mode: Input delivery mode for the model. Possible values include: "Copy", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mounting path of the model in the target image. - :paramtype mount_path: str - """ - super(ModelConfiguration, self).__init__(**kwargs) - self.mode = mode - self.mount_path = mount_path - - -class ModelContainer(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.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 ModelPackageInput(msrest.serialization.Model): - """Model package input options. - - All required parameters must be populated in order to send to Azure. - - :ivar input_type: Required. [Required] Type of the input included in the target image. Possible - values include: "UriFile", "UriFolder". - :vartype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :ivar mode: Input delivery mode of the input. Possible values include: "Copy", "Download". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :ivar mount_path: Relative mount path of the input in the target image. - :vartype mount_path: str - :ivar path: Required. [Required] Location of the input. - :vartype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - - _validation = { - 'input_type': {'required': True}, - 'path': {'required': True}, - } - - _attribute_map = { - 'input_type': {'key': 'inputType', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'PackageInputPathBase'}, - } - - def __init__( - self, - *, - input_type: Union[str, "PackageInputType"], - path: "PackageInputPathBase", - mode: Optional[Union[str, "PackageInputDeliveryMode"]] = None, - mount_path: Optional[str] = None, - **kwargs - ): - """ - :keyword input_type: Required. [Required] Type of the input included in the target image. - Possible values include: "UriFile", "UriFolder". - :paramtype input_type: str or ~azure.mgmt.machinelearningservices.models.PackageInputType - :keyword mode: Input delivery mode of the input. Possible values include: "Copy", "Download". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.PackageInputDeliveryMode - :keyword mount_path: Relative mount path of the input in the target image. - :paramtype mount_path: str - :keyword path: Required. [Required] Location of the input. - :paramtype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase - """ - super(ModelPackageInput, self).__init__(**kwargs) - self.input_type = input_type - self.mode = mode - self.mount_path = mount_path - self.path = path - - -class ModelPerformanceSignal(MonitoringSignalBase): - """Model performance signal definition. - - All required parameters must be populated in order to send to Azure. - - :ivar mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :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", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :ivar data_segment: The data segment. - :vartype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :ivar metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :vartype metric_threshold: - ~azure.mgmt.machinelearningservices.models.ModelPerformanceMetricThresholdBase - :ivar production_data: Required. [Required] The data produced by the production service 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}, - 'metric_threshold': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'ModelPerformanceMetricThresholdBase'}, - 'production_data': {'key': 'productionData', 'type': '[MonitoringInputDataBase]'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - metric_threshold: "ModelPerformanceMetricThresholdBase", - production_data: List["MonitoringInputDataBase"], - reference_data: "MonitoringInputDataBase", - mode: Optional[Union[str, "MonitoringNotificationMode"]] = None, - properties: Optional[Dict[str, str]] = None, - data_segment: Optional["MonitoringDataSegment"] = None, - **kwargs - ): - """ - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :keyword data_segment: The data segment. - :paramtype data_segment: ~azure.mgmt.machinelearningservices.models.MonitoringDataSegment - :keyword metric_threshold: Required. [Required] A list of metrics to calculate and their - associated thresholds. - :paramtype metric_threshold: - ~azure.mgmt.machinelearningservices.models.ModelPerformanceMetricThresholdBase - :keyword production_data: Required. [Required] The data produced by the production service - 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(ModelPerformanceSignal, self).__init__(mode=mode, properties=properties, **kwargs) - self.signal_type = 'ModelPerformance' # type: str - self.data_segment = data_segment - self.metric_threshold = metric_threshold - self.production_data = production_data - self.reference_data = reference_data - - -class ModelVersion(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.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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :vartype is_archived: bool - :ivar flavors: Mapping of model flavors to their properties. - :vartype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :ivar intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - '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, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - flavors: Optional[Dict[str, "FlavorData"]] = None, - intellectual_property: Optional["IntellectualProperty"] = 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :paramtype is_archived: bool - :keyword flavors: Mapping of model flavors to their properties. - :paramtype flavors: dict[str, ~azure.mgmt.machinelearningservices.models.FlavorData] - :keyword intellectual_property: Intellectual Property details. Used if model is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.flavors = flavors - self.intellectual_property = intellectual_property - 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_setting: The monitor's notification settings. - :vartype alert_notification_setting: - ~azure.mgmt.machinelearningservices.models.MonitoringAlertNotificationSettingsBase - :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 ARM resource ID of either the model or deployment targeted by this - 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_setting': {'key': 'alertNotificationSetting', 'type': 'MonitoringAlertNotificationSettingsBase'}, - '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_setting: Optional["MonitoringAlertNotificationSettingsBase"] = None, - monitoring_target: Optional["MonitoringTarget"] = None, - **kwargs - ): - """ - :keyword alert_notification_setting: The monitor's notification settings. - :paramtype alert_notification_setting: - ~azure.mgmt.machinelearningservices.models.MonitoringAlertNotificationSettingsBase - :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 ARM resource ID of either the model or deployment targeted by - this 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_setting = alert_notification_setting - self.compute_configuration = compute_configuration - self.monitoring_target = monitoring_target - self.signals = signals - - -class MonitoringDataSegment(msrest.serialization.Model): - """MonitoringDataSegment. - - :ivar feature: The feature to segment the data on. - :vartype feature: str - :ivar values: Filters for only the specified values of the given segmented feature. - :vartype values: list[str] - """ - - _attribute_map = { - 'feature': {'key': 'feature', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - } - - def __init__( - self, - *, - feature: Optional[str] = None, - values: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword feature: The feature to segment the data on. - :paramtype feature: str - :keyword values: Filters for only the specified values of the given segmented feature. - :paramtype values: list[str] - """ - super(MonitoringDataSegment, self).__init__(**kwargs) - self.feature = feature - self.values = values - - -class MonitoringTarget(msrest.serialization.Model): - """Monitoring target definition. - - All required parameters must be populated in order to send to Azure. - - :ivar deployment_id: The ARM resource ID of either the deployment targeted by this monitor. - :vartype deployment_id: str - :ivar model_id: The ARM resource ID of either the model targeted by this monitor. - :vartype model_id: str - :ivar task_type: Required. [Required] The machine learning task type of the model. Possible - values include: "Classification", "Regression", "QuestionAnswering". - :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: The ARM resource ID of either the deployment targeted by this monitor. - :paramtype deployment_id: str - :keyword model_id: The ARM resource ID of either the model targeted by this monitor. - :paramtype model_id: str - :keyword task_type: Required. [Required] The machine learning task type of the model. Possible - values include: "Classification", "Regression", "QuestionAnswering". - :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 MonitoringWorkspaceConnection(msrest.serialization.Model): - """Monitoring workspace connection definition. - - :ivar environment_variables: The properties of a workspace service connection to store as - environment variables in the submitted jobs. - Key is workspace connection property path, name is environment variable key. - :vartype environment_variables: dict[str, str] - :ivar secrets: The properties of a workspace service connection to store as secrets in the - submitted jobs. - Key is workspace connection property path, name is secret key. - :vartype secrets: dict[str, str] - """ - - _attribute_map = { - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'secrets': {'key': 'secrets', 'type': '{str}'}, - } - - def __init__( - self, - *, - environment_variables: Optional[Dict[str, str]] = None, - secrets: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword environment_variables: The properties of a workspace service connection to store as - environment variables in the submitted jobs. - Key is workspace connection property path, name is environment variable key. - :paramtype environment_variables: dict[str, str] - :keyword secrets: The properties of a workspace service connection to store as secrets in the - submitted jobs. - Key is workspace connection property path, name is secret key. - :paramtype secrets: dict[str, str] - """ - super(MonitoringWorkspaceConnection, self).__init__(**kwargs) - self.environment_variables = environment_variables - self.secrets = secrets - - -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'[a-zA-Z0-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", - "Ray". - :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 NlpFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML NLP training. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: int - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: int - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: int - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: int - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: float - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: float - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'float'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - *, - gradient_accumulation_steps: Optional[int] = None, - learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "NlpLearningRateScheduler"]] = None, - model_name: Optional[str] = None, - number_of_epochs: Optional[int] = None, - training_batch_size: Optional[int] = None, - validation_batch_size: Optional[int] = None, - warmup_ratio: Optional[float] = None, - weight_decay: Optional[float] = None, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: int - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. Possible values include: "None", "Linear", "Cosine", "CosineWithRestarts", - "Polynomial", "Constant", "ConstantWithWarmup". - :paramtype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.NlpLearningRateScheduler - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: int - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: int - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: int - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: float - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: float - """ - super(NlpFixedParameters, self).__init__(**kwargs) - self.gradient_accumulation_steps = gradient_accumulation_steps - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.number_of_epochs = number_of_epochs - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_ratio = warmup_ratio - self.weight_decay = weight_decay - - -class NlpParameterSubspace(msrest.serialization.Model): - """Stringified search spaces for each parameter. See below examples. - - :ivar gradient_accumulation_steps: Number of steps to accumulate gradients over before running - a backward pass. - :vartype gradient_accumulation_steps: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :vartype learning_rate_scheduler: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar number_of_epochs: Number of training epochs. - :vartype number_of_epochs: str - :ivar training_batch_size: The batch size for the training procedure. - :vartype training_batch_size: str - :ivar validation_batch_size: The batch size to be used during evaluation. - :vartype validation_batch_size: str - :ivar warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :vartype warmup_ratio: str - :ivar weight_decay: The weight decay for the training procedure. - :vartype weight_decay: str - """ - - _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - *, - gradient_accumulation_steps: Optional[str] = None, - learning_rate: Optional[str] = None, - learning_rate_scheduler: Optional[str] = None, - model_name: Optional[str] = None, - number_of_epochs: Optional[str] = None, - training_batch_size: Optional[str] = None, - validation_batch_size: Optional[str] = None, - warmup_ratio: Optional[str] = None, - weight_decay: Optional[str] = None, - **kwargs - ): - """ - :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before - running a backward pass. - :paramtype gradient_accumulation_steps: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword learning_rate_scheduler: The type of learning rate schedule to use during the training - procedure. - :paramtype learning_rate_scheduler: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword number_of_epochs: Number of training epochs. - :paramtype number_of_epochs: str - :keyword training_batch_size: The batch size for the training procedure. - :paramtype training_batch_size: str - :keyword validation_batch_size: The batch size to be used during evaluation. - :paramtype validation_batch_size: str - :keyword warmup_ratio: The warmup ratio, used alongside LrSchedulerType. - :paramtype warmup_ratio: str - :keyword weight_decay: The weight decay for the training procedure. - :paramtype weight_decay: str - """ - super(NlpParameterSubspace, self).__init__(**kwargs) - self.gradient_accumulation_steps = gradient_accumulation_steps - self.learning_rate = learning_rate - self.learning_rate_scheduler = learning_rate_scheduler - self.model_name = model_name - self.number_of_epochs = number_of_epochs - self.training_batch_size = training_batch_size - self.validation_batch_size = validation_batch_size - self.warmup_ratio = warmup_ratio - self.weight_decay = weight_decay - - -class NlpSweepSettings(msrest.serialization.Model): - """Model sweeping and hyperparameter tuning related settings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. 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 for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(NlpSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.sampling_algorithm = sampling_algorithm - - -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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - } - - def __init__( - self, - *, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_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_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of AutoML iterations. - :vartype max_trials: int - :ivar timeout: AutoML job timeout. - :vartype timeout: ~datetime.timedelta - :ivar trial_timeout: Timeout for individual HD trials. - :vartype trial_timeout: ~datetime.timedelta - """ - - _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, - } - - def __init__( - self, - *, - max_concurrent_trials: Optional[int] = 1, - max_nodes: Optional[int] = 1, - max_trials: Optional[int] = 1, - timeout: Optional[datetime.timedelta] = "P7D", - trial_timeout: Optional[datetime.timedelta] = None, - **kwargs - ): - """ - :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. - :paramtype max_concurrent_trials: int - :keyword max_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of AutoML iterations. - :paramtype max_trials: int - :keyword timeout: AutoML job timeout. - :paramtype timeout: ~datetime.timedelta - :keyword trial_timeout: Timeout for individual HD trials. - :paramtype trial_timeout: ~datetime.timedelta - """ - super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = max_concurrent_trials - self.max_nodes = max_nodes - self.max_trials = max_trials - self.timeout = timeout - self.trial_timeout = trial_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. - - 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", "AccessKey", "ApiKey", "CustomKeys". - :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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - metadata: Optional[Any] = None, - target: Optional[str] = None, - **kwargs - ): - """ - :keyword category: Category of the connection. Possible values include: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureSqlDb", "AzureSynapseAnalytics", - "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", "Redis", "ApiKey", "AzureOpenAI", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, metadata=metadata, target=target, **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", "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 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 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", "Hdfs", "OneLake". - :vartype datastore_type: str or ~azure.mgmt.machinelearningservices.models.DatastoreType - :ivar intellectual_property: Intellectual Property details. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - '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, - intellectual_property: Optional["IntellectualProperty"] = 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 intellectual_property: Intellectual Property details. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :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, intellectual_property=intellectual_property, **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 OnlineInferenceConfiguration(msrest.serialization.Model): - """Online inference configuration options. - - :ivar configurations: Additional configurations. - :vartype configurations: dict[str, str] - :ivar entry_script: Entry script or command to invoke. - :vartype entry_script: str - :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 = { - 'configurations': {'key': 'configurations', 'type': '{str}'}, - 'entry_script': {'key': 'entryScript', 'type': 'str'}, - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, - } - - def __init__( - self, - *, - configurations: Optional[Dict[str, str]] = None, - entry_script: Optional[str] = None, - liveness_route: Optional["Route"] = None, - readiness_route: Optional["Route"] = None, - scoring_route: Optional["Route"] = None, - **kwargs - ): - """ - :keyword configurations: Additional configurations. - :paramtype configurations: dict[str, str] - :keyword entry_script: Entry script or command to invoke. - :paramtype entry_script: str - :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(OnlineInferenceConfiguration, self).__init__(**kwargs) - self.configurations = configurations - self.entry_script = entry_script - self.liveness_route = liveness_route - self.readiness_route = readiness_route - self.scoring_route = scoring_route - - -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 OperationDisplay(msrest.serialization.Model): - """Display name of operation. - - :ivar description: Gets or sets the description for the operation. - :vartype description: str - :ivar operation: Gets or sets the operation that users can perform. - :vartype operation: str - :ivar provider: Gets or sets the resource provider name: - Microsoft.MachineLearningExperimentation. - :vartype provider: str - :ivar resource: Gets or sets the resource on which the operation is performed. - :vartype resource: str - """ - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - operation: Optional[str] = None, - provider: Optional[str] = None, - resource: Optional[str] = None, - **kwargs - ): - """ - :keyword description: Gets or sets the description for the operation. - :paramtype description: str - :keyword operation: Gets or sets the operation that users can perform. - :paramtype operation: str - :keyword provider: Gets or sets the resource provider name: - Microsoft.MachineLearningExperimentation. - :paramtype provider: str - :keyword resource: Gets or sets the resource on which the operation is performed. - :paramtype resource: str - """ - super(OperationDisplay, self).__init__(**kwargs) - self.description = description - self.operation = operation - self.provider = provider - self.resource = resource - - -class OutboundRuleBasicResource(Resource): - """Outbound Rule Basic Resource 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 id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the 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 PackageInputPathBase(msrest.serialization.Model): - """PackageInputPathBase. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: PackageInputPathId, PackageInputPathVersion, PackageInputPathUrl. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - } - - _subtype_map = { - 'input_path_type': {'PathId': 'PackageInputPathId', 'PathVersion': 'PackageInputPathVersion', 'Url': 'PackageInputPathUrl'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PackageInputPathBase, self).__init__(**kwargs) - self.input_path_type = None # type: Optional[str] - - -class PackageInputPathId(PackageInputPathBase): - """Package input path specified with a resource id. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_id: Input resource id. - :vartype resource_id: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_id: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_id: Input resource id. - :paramtype resource_id: str - """ - super(PackageInputPathId, self).__init__(**kwargs) - self.input_path_type = 'PathId' # type: str - self.resource_id = resource_id - - -class PackageInputPathUrl(PackageInputPathBase): - """Package input path specified as an url. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar url: Input path url. - :vartype url: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, - } - - def __init__( - self, - *, - url: Optional[str] = None, - **kwargs - ): - """ - :keyword url: Input path url. - :paramtype url: str - """ - super(PackageInputPathUrl, self).__init__(**kwargs) - self.input_path_type = 'Url' # type: str - self.url = url - - -class PackageInputPathVersion(PackageInputPathBase): - """Package input path specified with name and version. - - All required parameters must be populated in order to send to Azure. - - :ivar input_path_type: Required. [Required] Input path type for package inputs.Constant filled - by server. Possible values include: "Url", "PathId", "PathVersion". - :vartype input_path_type: str or ~azure.mgmt.machinelearningservices.models.InputPathType - :ivar resource_name: Input resource name. - :vartype resource_name: str - :ivar resource_version: Input resource version. - :vartype resource_version: str - """ - - _validation = { - 'input_path_type': {'required': True}, - } - - _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_name': {'key': 'resourceName', 'type': 'str'}, - 'resource_version': {'key': 'resourceVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_name: Optional[str] = None, - resource_version: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_name: Input resource name. - :paramtype resource_name: str - :keyword resource_version: Input resource version. - :paramtype resource_version: str - """ - super(PackageInputPathVersion, self).__init__(**kwargs) - self.input_path_type = 'PathVersion' # type: str - self.resource_name = resource_name - self.resource_version = resource_version - - -class PackageRequest(msrest.serialization.Model): - """Model package operation request properties. - - All required parameters must be populated in order to send to Azure. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Required. [Required] Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_id: Required. [Required] Arm ID of the target environment to be - created by package operation. - :vartype target_environment_id: str - """ - - _validation = { - 'inferencing_server': {'required': True}, - 'target_environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - } - - def __init__( - self, - *, - inferencing_server: "InferencingServer", - target_environment_id: str, - base_environment_source: Optional["BaseEnvironmentSource"] = None, - environment_variables: Optional[Dict[str, str]] = None, - inputs: Optional[List["ModelPackageInput"]] = None, - model_configuration: Optional["ModelConfiguration"] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword base_environment_source: Base environment to start with. - :paramtype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :keyword environment_variables: Collection of environment variables. - :paramtype environment_variables: dict[str, str] - :keyword inferencing_server: Required. [Required] Inferencing server configurations. - :paramtype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :keyword inputs: Collection of inputs. - :paramtype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :keyword model_configuration: Model configuration including the mount mode. - :paramtype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :paramtype tags: dict[str, str] - :keyword target_environment_id: Required. [Required] Arm ID of the target environment to be - created by package operation. - :paramtype target_environment_id: str - """ - super(PackageRequest, self).__init__(**kwargs) - self.base_environment_source = base_environment_source - self.environment_variables = environment_variables - self.inferencing_server = inferencing_server - self.inputs = inputs - self.model_configuration = model_configuration - self.tags = tags - self.target_environment_id = target_environment_id - - -class PackageResponse(msrest.serialization.Model): - """Package response returned after async package operation completes successfully. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar base_environment_source: Base environment to start with. - :vartype base_environment_source: - ~azure.mgmt.machinelearningservices.models.BaseEnvironmentSource - :ivar build_id: Build id of the image build operation. - :vartype build_id: str - :ivar build_state: Build state of the image build operation. Possible values include: - "NotStarted", "Running", "Succeeded", "Failed". - :vartype build_state: str or ~azure.mgmt.machinelearningservices.models.PackageBuildState - :ivar environment_variables: Collection of environment variables. - :vartype environment_variables: dict[str, str] - :ivar inferencing_server: Inferencing server configurations. - :vartype inferencing_server: ~azure.mgmt.machinelearningservices.models.InferencingServer - :ivar inputs: Collection of inputs. - :vartype inputs: list[~azure.mgmt.machinelearningservices.models.ModelPackageInput] - :ivar log_url: Log url of the image build operation. - :vartype log_url: str - :ivar model_configuration: Model configuration including the mount mode. - :vartype model_configuration: ~azure.mgmt.machinelearningservices.models.ModelConfiguration - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar target_environment_id: Asset ID of the target environment created by package operation. - :vartype target_environment_id: str - """ - - _validation = { - 'base_environment_source': {'readonly': True}, - 'build_id': {'readonly': True}, - 'build_state': {'readonly': True}, - 'environment_variables': {'readonly': True}, - 'inferencing_server': {'readonly': True}, - 'inputs': {'readonly': True}, - 'log_url': {'readonly': True}, - 'model_configuration': {'readonly': True}, - 'tags': {'readonly': True}, - 'target_environment_id': {'readonly': True}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'build_id': {'key': 'buildId', 'type': 'str'}, - 'build_state': {'key': 'buildState', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'log_url': {'key': 'logUrl', 'type': 'str'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(PackageResponse, self).__init__(**kwargs) - self.base_environment_source = None - self.build_id = None - self.build_state = None - self.environment_variables = None - self.inferencing_server = None - self.inputs = None - self.log_url = None - self.model_configuration = None - self.tags = None - self.target_environment_id = 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, - *, - 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 PartialJobBase(msrest.serialization.Model): - """Mutable base definition for a job. - - :ivar notification_setting: Mutable notification setting for the job. - :vartype notification_setting: - ~azure.mgmt.machinelearningservices.models.PartialNotificationSetting - """ - - _attribute_map = { - 'notification_setting': {'key': 'notificationSetting', 'type': 'PartialNotificationSetting'}, - } - - def __init__( - self, - *, - notification_setting: Optional["PartialNotificationSetting"] = None, - **kwargs - ): - """ - :keyword notification_setting: Mutable notification setting for the job. - :paramtype notification_setting: - ~azure.mgmt.machinelearningservices.models.PartialNotificationSetting - """ - super(PartialJobBase, self).__init__(**kwargs) - self.notification_setting = notification_setting - - -class PartialJobBasePartialResource(msrest.serialization.Model): - """Azure Resource Manager resource envelope strictly used in update requests. - - :ivar properties: Additional attributes of the entity. - :vartype properties: ~azure.mgmt.machinelearningservices.models.PartialJobBase - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialJobBase'}, - } - - def __init__( - self, - *, - properties: Optional["PartialJobBase"] = None, - **kwargs - ): - """ - :keyword properties: Additional attributes of the entity. - :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialJobBase - """ - super(PartialJobBasePartialResource, self).__init__(**kwargs) - self.properties = properties - - -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 PartialNotificationSetting(msrest.serialization.Model): - """Mutable configuration for notification. - - :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 = { - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, - } - - def __init__( - self, - *, - webhooks: Optional[Dict[str, "Webhook"]] = None, - **kwargs - ): - """ - :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(PartialNotificationSetting, self).__init__(**kwargs) - self.webhooks = webhooks - - -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. - - 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", "AccessKey", "ApiKey", "CustomKeys". - :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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - metadata: Optional[Any] = None, - target: Optional[str] = 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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken - """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, metadata=metadata, target=target, **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", "Labeling", "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 secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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 - :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'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - '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, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = 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 secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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, secrets_configuration=secrets_configuration, 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 mode: The current notification mode for this signal. Possible values include: "Disabled", - "Enabled". - :vartype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :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", "ModelPerformance", "GenerationSafetyQuality", - "GenerationTokenStatistics". - :vartype signal_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringSignalType - :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 model_type: Required. [Required] The type of the model monitored. Possible values - include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :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}, - 'model_type': {'required': True}, - 'production_data': {'required': True}, - 'reference_data': {'required': True}, - } - - _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[PredictionDriftMetricThresholdBase]'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'production_data': {'key': 'productionData', 'type': 'MonitoringInputDataBase'}, - 'reference_data': {'key': 'referenceData', 'type': 'MonitoringInputDataBase'}, - } - - def __init__( - self, - *, - metric_thresholds: List["PredictionDriftMetricThresholdBase"], - model_type: Union[str, "MonitoringModelType"], - production_data: "MonitoringInputDataBase", - reference_data: "MonitoringInputDataBase", - mode: Optional[Union[str, "MonitoringNotificationMode"]] = None, - properties: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword mode: The current notification mode for this signal. Possible values include: - "Disabled", "Enabled". - :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode - :keyword properties: Property dictionary. Properties can be added, but not removed or altered. - :paramtype properties: dict[str, str] - :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 model_type: Required. [Required] The type of the model monitored. Possible values - include: "Classification", "Regression". - :paramtype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :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__(mode=mode, properties=properties, **kwargs) - self.signal_type = 'PredictionDrift' # type: str - self.metric_thresholds = metric_thresholds - self.model_type = model_type - 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}, - 'provisioning_state': {'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, - **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 - """ - 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 = 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 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. - - 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". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :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 - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'PrivateEndpointDestination'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "RuleCategory"]] = None, - status: Optional[Union[str, "RuleStatus"]] = None, - destination: Optional["PrivateEndpointDestination"] = None, - **kwargs - ): - """ - :keyword category: Category of a managed network Outbound Rule of a machine learning workspace. - Possible values include: "Required", "Recommended", "UserDefined". - :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 - """ - super(PrivateEndpointOutboundRule, self).__init__(category=category, status=status, **kwargs) - self.type = 'PrivateEndpoint' # type: str - self.destination = destination - - -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 ProgressMetrics(msrest.serialization.Model): - """Progress metrics definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar completed_datapoint_count: The completed datapoint count. - :vartype completed_datapoint_count: long - :ivar incremental_data_last_refresh_date_time: The time of last successful incremental data - refresh in UTC. - :vartype incremental_data_last_refresh_date_time: ~datetime.datetime - :ivar skipped_datapoint_count: The skipped datapoint count. - :vartype skipped_datapoint_count: long - :ivar total_datapoint_count: The total datapoint count. - :vartype total_datapoint_count: long - """ - - _validation = { - 'completed_datapoint_count': {'readonly': True}, - 'incremental_data_last_refresh_date_time': {'readonly': True}, - 'skipped_datapoint_count': {'readonly': True}, - 'total_datapoint_count': {'readonly': True}, - } - - _attribute_map = { - 'completed_datapoint_count': {'key': 'completedDatapointCount', 'type': 'long'}, - 'incremental_data_last_refresh_date_time': {'key': 'incrementalDataLastRefreshDateTime', 'type': 'iso-8601'}, - 'skipped_datapoint_count': {'key': 'skippedDatapointCount', 'type': 'long'}, - 'total_datapoint_count': {'key': 'totalDatapointCount', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProgressMetrics, self).__init__(**kwargs) - self.completed_datapoint_count = None - self.incremental_data_last_refresh_date_time = None - self.skipped_datapoint_count = None - self.total_datapoint_count = 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", - "Ray". - :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 - :ivar priority: Controls the priority of the job on a compute. - :vartype priority: int - """ - - _attribute_map = { - 'job_tier': {'key': 'jobTier', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - } - - def __init__( - self, - *, - job_tier: Optional[Union[str, "JobTier"]] = None, - priority: Optional[int] = 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 - :keyword priority: Controls the priority of the job on a compute. - :paramtype priority: int - """ - super(QueueSettings, self).__init__(**kwargs) - self.job_tier = job_tier - self.priority = priority - - -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 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 logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :vartype logbase: str - :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'}, - 'logbase': {'key': 'logbase', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, - } - - def __init__( - self, - *, - logbase: Optional[str] = None, - rule: Optional[Union[str, "RandomSamplingAlgorithmRule"]] = None, - seed: Optional[int] = None, - **kwargs - ): - """ - :keyword logbase: An optional positive number or e in string format to be used as base for log - based random sampling. - :paramtype logbase: str - :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.logbase = logbase - self.rule = rule - self.seed = seed - - -class Ray(DistributionConfiguration): - """Ray 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", - "Ray". - :vartype distribution_type: str or ~azure.mgmt.machinelearningservices.models.DistributionType - :ivar address: The address of Ray head node. - :vartype address: str - :ivar dashboard_port: The port to bind the dashboard server to. - :vartype dashboard_port: int - :ivar head_node_additional_args: Additional arguments passed to ray start in head node. - :vartype head_node_additional_args: str - :ivar include_dashboard: Provide this argument to start the Ray dashboard GUI. - :vartype include_dashboard: bool - :ivar port: The port of the head ray process. - :vartype port: int - :ivar worker_node_additional_args: Additional arguments passed to ray start in worker node. - :vartype worker_node_additional_args: str - """ - - _validation = { - 'distribution_type': {'required': True}, - } - - _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'address': {'key': 'address', 'type': 'str'}, - 'dashboard_port': {'key': 'dashboardPort', 'type': 'int'}, - 'head_node_additional_args': {'key': 'headNodeAdditionalArgs', 'type': 'str'}, - 'include_dashboard': {'key': 'includeDashboard', 'type': 'bool'}, - 'port': {'key': 'port', 'type': 'int'}, - 'worker_node_additional_args': {'key': 'workerNodeAdditionalArgs', 'type': 'str'}, - } - - def __init__( - self, - *, - address: Optional[str] = None, - dashboard_port: Optional[int] = None, - head_node_additional_args: Optional[str] = None, - include_dashboard: Optional[bool] = None, - port: Optional[int] = None, - worker_node_additional_args: Optional[str] = None, - **kwargs - ): - """ - :keyword address: The address of Ray head node. - :paramtype address: str - :keyword dashboard_port: The port to bind the dashboard server to. - :paramtype dashboard_port: int - :keyword head_node_additional_args: Additional arguments passed to ray start in head node. - :paramtype head_node_additional_args: str - :keyword include_dashboard: Provide this argument to start the Ray dashboard GUI. - :paramtype include_dashboard: bool - :keyword port: The port of the head ray process. - :paramtype port: int - :keyword worker_node_additional_args: Additional arguments passed to ray start in worker node. - :paramtype worker_node_additional_args: str - """ - super(Ray, self).__init__(**kwargs) - self.distribution_type = 'Ray' # type: str - self.address = address - self.dashboard_port = dashboard_port - self.head_node_additional_args = head_node_additional_args - self.include_dashboard = include_dashboard - self.port = port - self.worker_node_additional_args = worker_node_additional_args - - -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.RecurrenceFrequency - :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.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] = "UTC", - schedule: Optional["RecurrenceSchedule"] = 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.RecurrenceFrequency - :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.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): - """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 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 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'}, - '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, - 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 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.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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - '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, - fixed_parameters: Optional["TableFixedParameters"] = None, - limit_settings: Optional["TableVerticalLimitSettings"] = None, - n_cross_validations: Optional["NCrossValidations"] = None, - search_space: Optional[List["TableParameterSubspace"]] = None, - sweep_settings: Optional["TableSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.TableFixedParameters - :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 search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: - list[~azure.mgmt.machinelearningservices.models.TableParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.TableSweepSettings - :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, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, 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.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.n_cross_validations = n_cross_validations - self.search_space = search_space - self.sweep_settings = sweep_settings - 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 RegressionModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): - """RegressionModelPerformanceMetricThreshold. - - All required parameters must be populated in order to send to Azure. - - :ivar model_type: Required. [Required] Specifies the data type of the metric threshold.Constant - filled by server. Possible values include: "Classification", "Regression". - :vartype model_type: str or ~azure.mgmt.machinelearningservices.models.MonitoringModelType - :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 regression model performance metric to calculate. - Possible values include: "MeanAbsoluteError", "RootMeanSquaredError", "MeanSquaredError". - :vartype metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionModelPerformanceMetric - """ - - _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, - } - - _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, - } - - def __init__( - self, - *, - metric: Union[str, "RegressionModelPerformanceMetric"], - 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 regression model performance metric to calculate. - Possible values include: "MeanAbsoluteError", "RootMeanSquaredError", "MeanSquaredError". - :paramtype metric: str or - ~azure.mgmt.machinelearningservices.models.RegressionModelPerformanceMetric - """ - super(RegressionModelPerformanceMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.model_type = 'Regression' # type: str - self.metric = metric - - -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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :vartype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - '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, - training_mode: Optional[Union[str, "TrainingMode"]] = 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 training_mode: TrainingMode mode - Setting to 'auto' is same as setting it to - 'non-distributed' for now, however in the future may result in mixed mode or heuristics based - mode selection. Default is 'auto'. - If 'Distributed' then only distributed featurization is used and distributed algorithms are - chosen. - If 'NonDistributed' then only non distributed algorithms are chosen. Possible values include: - "Auto", "Distributed", "NonDistributed". - :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode - :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, training_mode=training_mode, **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 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 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. - - 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", "AccessKey", "ApiKey", "CustomKeys". - :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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - metadata: Optional[Any] = None, - target: Optional[str] = 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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature - """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, metadata=metadata, target=target, **kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = credentials - - -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", "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 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(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.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 SecretConfiguration(msrest.serialization.Model): - """Secret Configuration definition. - - :ivar uri: Secret Uri. - Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion. - :vartype uri: str - :ivar workspace_secret_name: Name of secret in workspace key vault. - :vartype workspace_secret_name: str - """ - - _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - 'workspace_secret_name': {'key': 'workspaceSecretName', 'type': 'str'}, - } - - def __init__( - self, - *, - uri: Optional[str] = None, - workspace_secret_name: Optional[str] = None, - **kwargs - ): - """ - :keyword uri: Secret Uri. - Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion. - :paramtype uri: str - :keyword workspace_secret_name: Name of secret in workspace key vault. - :paramtype workspace_secret_name: str - """ - super(SecretConfiguration, self).__init__(**kwargs) - self.uri = uri - self.workspace_secret_name = workspace_secret_name - - -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. - - 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", "AccessKey", "ApiKey", "CustomKeys". - :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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - metadata: Optional[Any] = None, - target: Optional[str] = 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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal - """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, metadata=metadata, target=target, **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", "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 ServiceTagDestination(msrest.serialization.Model): - """Service Tag destination for a 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. - - :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 - """ - - _validation = { - 'address_prefixes': {'readonly': True}, - } - - _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, - 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 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 = None - 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. - - 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". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.RuleCategory - :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 = { - 'type': {'required': True}, - } - - _attribute_map = { - 'category': {'key': 'category', '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". - :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", "Labeling", "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 secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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 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 resource 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 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'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - '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'}, - '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, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = 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, - 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 secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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 resource 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 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, secrets_configuration=secrets_configuration, 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.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 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", "Trailing", "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: The ARM resource ID of the component resource 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: The ARM resource ID of the component resource 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 StatusMessage(msrest.serialization.Model): - """Active message associated with project. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Service-defined message code. - :vartype code: str - :ivar created_date_time: Time in UTC at which the message was created. - :vartype created_date_time: ~datetime.datetime - :ivar level: Severity level of message. Possible values include: "Error", "Information", - "Warning". - :vartype level: str or ~azure.mgmt.machinelearningservices.models.StatusMessageLevel - :ivar message: A human-readable representation of the message code. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(StatusMessage, self).__init__(**kwargs) - self.code = None - self.created_date_time = None - self.level = None - self.message = None - - -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", "Labeling", "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 secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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 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'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - '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, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = 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 secrets_configuration: Configuration for secrets to be made available during runtime. - :paramtype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :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, secrets_configuration=secrets_configuration, 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 TableFixedParameters(msrest.serialization.Model): - """Fixed training parameters that won't be swept over during AutoML Table training. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: float - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: int - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: int - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: int - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: int - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: float - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: int - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: int - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: float - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: float - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: float - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: float - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: bool - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: bool - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'max_bin': {'key': 'maxBin', 'type': 'int'}, - 'max_depth': {'key': 'maxDepth', 'type': 'int'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'int'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'int'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'float'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'int'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'int'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'float'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'float'}, - 'subsample': {'key': 'subsample', 'type': 'float'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'float'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'bool'}, - 'with_std': {'key': 'withStd', 'type': 'bool'}, - } - - def __init__( - self, - *, - booster: Optional[str] = None, - boosting_type: Optional[str] = None, - grow_policy: Optional[str] = None, - learning_rate: Optional[float] = None, - max_bin: Optional[int] = None, - max_depth: Optional[int] = None, - max_leaves: Optional[int] = None, - min_data_in_leaf: Optional[int] = None, - min_split_gain: Optional[float] = None, - model_name: Optional[str] = None, - n_estimators: Optional[int] = None, - num_leaves: Optional[int] = None, - preprocessor_name: Optional[str] = None, - reg_alpha: Optional[float] = None, - reg_lambda: Optional[float] = None, - subsample: Optional[float] = None, - subsample_freq: Optional[float] = None, - tree_method: Optional[str] = None, - with_mean: Optional[bool] = False, - with_std: Optional[bool] = False, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: float - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: int - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: int - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: int - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: int - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: float - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: int - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: int - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: float - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: float - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: float - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: float - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: bool - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: bool - """ - super(TableFixedParameters, self).__init__(**kwargs) - self.booster = booster - self.boosting_type = boosting_type - self.grow_policy = grow_policy - self.learning_rate = learning_rate - self.max_bin = max_bin - self.max_depth = max_depth - self.max_leaves = max_leaves - self.min_data_in_leaf = min_data_in_leaf - self.min_split_gain = min_split_gain - self.model_name = model_name - self.n_estimators = n_estimators - self.num_leaves = num_leaves - self.preprocessor_name = preprocessor_name - self.reg_alpha = reg_alpha - self.reg_lambda = reg_lambda - self.subsample = subsample - self.subsample_freq = subsample_freq - self.tree_method = tree_method - self.with_mean = with_mean - self.with_std = with_std - - -class TableParameterSubspace(msrest.serialization.Model): - """TableParameterSubspace. - - :ivar booster: Specify the boosting type, e.g gbdt for XGBoost. - :vartype booster: str - :ivar boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :vartype boosting_type: str - :ivar grow_policy: Specify the grow policy, which controls the way new nodes are added to the - tree. - :vartype grow_policy: str - :ivar learning_rate: The learning rate for the training procedure. - :vartype learning_rate: str - :ivar max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :vartype max_bin: str - :ivar max_depth: Specify the max depth to limit the tree depth explicitly. - :vartype max_depth: str - :ivar max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :vartype max_leaves: str - :ivar min_data_in_leaf: The minimum number of data per leaf. - :vartype min_data_in_leaf: str - :ivar min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :vartype min_split_gain: str - :ivar model_name: The name of the model to train. - :vartype model_name: str - :ivar n_estimators: Specify the number of trees (or rounds) in an model. - :vartype n_estimators: str - :ivar num_leaves: Specify the number of leaves. - :vartype num_leaves: str - :ivar preprocessor_name: The name of the preprocessor to use. - :vartype preprocessor_name: str - :ivar reg_alpha: L1 regularization term on weights. - :vartype reg_alpha: str - :ivar reg_lambda: L2 regularization term on weights. - :vartype reg_lambda: str - :ivar subsample: Subsample ratio of the training instance. - :vartype subsample: str - :ivar subsample_freq: Frequency of subsample. - :vartype subsample_freq: str - :ivar tree_method: Specify the tree method. - :vartype tree_method: str - :ivar with_mean: If true, center before scaling the data with StandardScalar. - :vartype with_mean: str - :ivar with_std: If true, scaling the data with Unit Variance with StandardScalar. - :vartype with_std: str - """ - - _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'max_bin': {'key': 'maxBin', 'type': 'str'}, - 'max_depth': {'key': 'maxDepth', 'type': 'str'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'str'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'str'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'str'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'str'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'str'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'str'}, - 'subsample': {'key': 'subsample', 'type': 'str'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'str'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'str'}, - 'with_std': {'key': 'withStd', 'type': 'str'}, - } - - def __init__( - self, - *, - booster: Optional[str] = None, - boosting_type: Optional[str] = None, - grow_policy: Optional[str] = None, - learning_rate: Optional[str] = None, - max_bin: Optional[str] = None, - max_depth: Optional[str] = None, - max_leaves: Optional[str] = None, - min_data_in_leaf: Optional[str] = None, - min_split_gain: Optional[str] = None, - model_name: Optional[str] = None, - n_estimators: Optional[str] = None, - num_leaves: Optional[str] = None, - preprocessor_name: Optional[str] = None, - reg_alpha: Optional[str] = None, - reg_lambda: Optional[str] = None, - subsample: Optional[str] = None, - subsample_freq: Optional[str] = None, - tree_method: Optional[str] = None, - with_mean: Optional[str] = None, - with_std: Optional[str] = None, - **kwargs - ): - """ - :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. - :paramtype booster: str - :keyword boosting_type: Specify the boosting type, e.g gbdt for LightGBM. - :paramtype boosting_type: str - :keyword grow_policy: Specify the grow policy, which controls the way new nodes are added to - the tree. - :paramtype grow_policy: str - :keyword learning_rate: The learning rate for the training procedure. - :paramtype learning_rate: str - :keyword max_bin: Specify the Maximum number of discrete bins to bucket continuous features . - :paramtype max_bin: str - :keyword max_depth: Specify the max depth to limit the tree depth explicitly. - :paramtype max_depth: str - :keyword max_leaves: Specify the max leaves to limit the tree leaves explicitly. - :paramtype max_leaves: str - :keyword min_data_in_leaf: The minimum number of data per leaf. - :paramtype min_data_in_leaf: str - :keyword min_split_gain: Minimum loss reduction required to make a further partition on a leaf - node of the tree. - :paramtype min_split_gain: str - :keyword model_name: The name of the model to train. - :paramtype model_name: str - :keyword n_estimators: Specify the number of trees (or rounds) in an model. - :paramtype n_estimators: str - :keyword num_leaves: Specify the number of leaves. - :paramtype num_leaves: str - :keyword preprocessor_name: The name of the preprocessor to use. - :paramtype preprocessor_name: str - :keyword reg_alpha: L1 regularization term on weights. - :paramtype reg_alpha: str - :keyword reg_lambda: L2 regularization term on weights. - :paramtype reg_lambda: str - :keyword subsample: Subsample ratio of the training instance. - :paramtype subsample: str - :keyword subsample_freq: Frequency of subsample. - :paramtype subsample_freq: str - :keyword tree_method: Specify the tree method. - :paramtype tree_method: str - :keyword with_mean: If true, center before scaling the data with StandardScalar. - :paramtype with_mean: str - :keyword with_std: If true, scaling the data with Unit Variance with StandardScalar. - :paramtype with_std: str - """ - super(TableParameterSubspace, self).__init__(**kwargs) - self.booster = booster - self.boosting_type = boosting_type - self.grow_policy = grow_policy - self.learning_rate = learning_rate - self.max_bin = max_bin - self.max_depth = max_depth - self.max_leaves = max_leaves - self.min_data_in_leaf = min_data_in_leaf - self.min_split_gain = min_split_gain - self.model_name = model_name - self.n_estimators = n_estimators - self.num_leaves = num_leaves - self.preprocessor_name = preprocessor_name - self.reg_alpha = reg_alpha - self.reg_lambda = reg_lambda - self.subsample = subsample - self.subsample_freq = subsample_freq - self.tree_method = tree_method - self.with_mean = with_mean - self.with_std = with_std - - -class TableSweepSettings(msrest.serialization.Model): - """TableSweepSettings. - - All required parameters must be populated in order to send to Azure. - - :ivar early_termination: Type of early termination policy for the sweeping job. - :vartype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :ivar sampling_algorithm: Required. [Required] Type of sampling algorithm. 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 for the sweeping job. - :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy - :keyword sampling_algorithm: Required. [Required] Type of sampling algorithm. Possible values - include: "Grid", "Random", "Bayesian". - :paramtype sampling_algorithm: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType - """ - super(TableSweepSettings, self).__init__(**kwargs) - self.early_termination = early_termination - self.sampling_algorithm = sampling_algorithm - - -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_nodes: Maximum nodes to use for the experiment. - :vartype max_nodes: int - :ivar max_trials: Number of iterations. - :vartype max_trials: int - :ivar sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to trigger. - :vartype sweep_concurrent_trials: int - :ivar sweep_trials: Number of sweeping runs that user wants to trigger. - :vartype sweep_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_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'sweep_concurrent_trials': {'key': 'sweepConcurrentTrials', 'type': 'int'}, - 'sweep_trials': {'key': 'sweepTrials', '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_nodes: Optional[int] = 1, - max_trials: Optional[int] = 1000, - sweep_concurrent_trials: Optional[int] = 0, - sweep_trials: Optional[int] = 0, - 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_nodes: Maximum nodes to use for the experiment. - :paramtype max_nodes: int - :keyword max_trials: Number of iterations. - :paramtype max_trials: int - :keyword sweep_concurrent_trials: Number of concurrent sweeping runs that user wants to - trigger. - :paramtype sweep_concurrent_trials: int - :keyword sweep_trials: Number of sweeping runs that user wants to trigger. - :paramtype sweep_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_nodes = max_nodes - self.max_trials = max_trials - self.sweep_concurrent_trials = sweep_concurrent_trials - self.sweep_trials = sweep_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", - "Ray". - :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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - '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, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - '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, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - '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, - fixed_parameters: Optional["NlpFixedParameters"] = None, - limit_settings: Optional["NlpVerticalLimitSettings"] = None, - search_space: Optional[List["NlpParameterSubspace"]] = None, - sweep_settings: Optional["NlpSweepSettings"] = 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 fixed_parameters: Model/training parameters that will remain constant throughout - training. - :paramtype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :keyword limit_settings: Execution constraints for AutoMLJob. - :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :keyword search_space: Search space for sampling different combinations of models and their - hyperparameters. - :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :keyword sweep_settings: Settings for model sweeping and hyperparameter tuning. - :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :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, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) - self.featurization_settings = featurization_settings - self.fixed_parameters = fixed_parameters - self.limit_settings = limit_settings - self.search_space = search_space - self.sweep_settings = sweep_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 TrailingInputData(MonitoringInputDataBase): - """Trailing 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", "Trailing", "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: The ARM resource ID of the component resource 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 trailing 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: The ARM resource ID of the component resource 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 trailing data window. - :paramtype window_size: ~datetime.timedelta - """ - super(TrailingInputData, self).__init__(columns=columns, data_context=data_context, job_input_type=job_input_type, uri=uri, **kwargs) - self.input_data_type = 'Trailing' # type: str - self.preprocessing_component_id = preprocessing_component_id - self.window_offset = window_offset - self.window_size = window_size - - -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 TritonInferencingServer(InferencingServer): - """Triton inferencing server configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar server_type: Required. [Required] Inferencing server type for various targets.Constant - filled by server. Possible values include: "AzureMLOnline", "AzureMLBatch", "Triton", "Custom". - :vartype server_type: str or ~azure.mgmt.machinelearningservices.models.InferencingServerType - :ivar inference_configuration: Inference configuration for Triton. - :vartype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - - _validation = { - 'server_type': {'required': True}, - } - - _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, - } - - def __init__( - self, - *, - inference_configuration: Optional["OnlineInferenceConfiguration"] = None, - **kwargs - ): - """ - :keyword inference_configuration: Inference configuration for Triton. - :paramtype inference_configuration: - ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration - """ - super(TritonInferencingServer, self).__init__(**kwargs) - self.server_type = 'Triton' # type: str - self.inference_configuration = inference_configuration - - -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 asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = 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 asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: 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}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(UriFileDataVersion, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **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 asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = 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 asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :ivar is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :vartype is_anonymous: bool - :ivar is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :vartype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :ivar stage: Stage in the data lifecycle assigned to this data asset. - :vartype stage: 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}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - } - - def __init__( - self, - *, - data_uri: str, - description: Optional[str] = None, - properties: Optional[Dict[str, str]] = None, - tags: Optional[Dict[str, str]] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = None, - is_anonymous: Optional[bool] = False, - is_archived: Optional[bool] = False, - intellectual_property: Optional["IntellectualProperty"] = 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 auto_delete_setting: Specifies the lifecycle setting of managed data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :keyword is_anonymous: If the name version are system generated (anonymous registration). For - types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - :paramtype is_anonymous: bool - :keyword is_archived: Is the asset archived? For types where Stage is defined, when Stage is - provided it will be used to populate IsArchived. - :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 intellectual_property: Intellectual Property details. Used if data is an Intellectual - Property. - :paramtype intellectual_property: - ~azure.mgmt.machinelearningservices.models.IntellectualProperty - :keyword stage: Stage in the data lifecycle assigned to this data asset. - :paramtype stage: str - """ - super(UriFolderDataVersion, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **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 asset_version: Output Asset Version. - :vartype asset_version: str - :ivar auto_delete_setting: Auto delete setting of output data asset. - :vartype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - '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, - asset_version: Optional[str] = None, - auto_delete_setting: Optional["AutoDeleteSetting"] = 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 asset_version: Output Asset Version. - :paramtype asset_version: str - :keyword auto_delete_setting: Auto delete setting of output data asset. - :paramtype auto_delete_setting: ~azure.mgmt.machinelearningservices.models.AutoDeleteSetting - :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, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) - self.asset_name = asset_name - self.asset_version = asset_version - self.auto_delete_setting = auto_delete_setting - 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. - - 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", "AccessKey", "ApiKey", "CustomKeys". - :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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :vartype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar metadata: Any object. - :vartype metadata: any - :ivar target: - :vartype target: str - :ivar credentials: - :vartype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'target': {'key': 'target', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, - } - - def __init__( - self, - *, - category: Optional[Union[str, "ConnectionCategory"]] = None, - expiry_time: Optional[datetime.datetime] = None, - metadata: Optional[Any] = None, - target: Optional[str] = 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", - "CognitiveSearch", "CognitiveService", "CustomKeys". - :paramtype category: str or ~azure.mgmt.machinelearningservices.models.ConnectionCategory - :keyword expiry_time: - :paramtype expiry_time: ~datetime.datetime - :keyword metadata: Any object. - :paramtype metadata: any - :keyword target: - :paramtype target: str - :keyword credentials: - :paramtype credentials: - ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword - """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, expiry_time=expiry_time, metadata=metadata, target=target, **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 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 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 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 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'}, - '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'}, - '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'}, - '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'}, - '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, - 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, - 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, - 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, - 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 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 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 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 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.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.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.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.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 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 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 username: - :vartype username: str - """ - - _attribute_map = { - 'password': {'key': 'password', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - } - - def __init__( - self, - *, - password: Optional[str] = None, - username: Optional[str] = None, - **kwargs - ): - """ - :keyword password: - :paramtype password: str - :keyword username: - :paramtype username: str - """ - super(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.password = password - 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 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 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 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 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 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}'}, - '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'}, - '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'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - '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, - application_insights: Optional[str] = None, - container_registry: Optional[str] = None, - description: Optional[str] = None, - enable_data_isolation: Optional[bool] = None, - encryption: Optional["EncryptionUpdateProperties"] = None, - feature_store_settings: Optional["FeatureStoreSettings"] = None, - friendly_name: Optional[str] = None, - image_build_compute: Optional[str] = None, - managed_network: Optional["ManagedNetworkSettings"] = None, - primary_user_assigned_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, - soft_delete_retention_in_days: Optional[int] = 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 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 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 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 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 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.application_insights = application_insights - self.container_registry = container_registry - self.description = description - self.enable_data_isolation = enable_data_isolation - self.encryption = encryption - self.feature_store_settings = feature_store_settings - self.friendly_name = friendly_name - self.image_build_compute = image_build_compute - self.managed_network = managed_network - self.primary_user_assigned_identity = primary_user_assigned_identity - self.public_network_access = public_network_access - self.service_managed_resources_settings = service_managed_resources_settings - self.soft_delete_retention_in_days = soft_delete_retention_in_days - self.v1_legacy_mode = v1_legacy_mode diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/__init__.py deleted file mode 100644 index 46cd9a8ab550..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/__init__.py +++ /dev/null @@ -1,103 +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_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 ._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 ._labeling_jobs_operations import LabelingJobsOperations -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 ._operations import Operations -from ._workspaces_operations import WorkspacesOperations -from ._workspace_connections_operations import WorkspaceConnectionsOperations -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', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'FeaturesetContainersOperations', - 'FeaturesOperations', - 'FeaturesetVersionsOperations', - 'FeaturestoreEntityContainersOperations', - 'FeaturestoreEntityVersionsOperations', - 'JobsOperations', - 'LabelingJobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', - 'Operations', - 'WorkspacesOperations', - 'WorkspaceConnectionsOperations', - 'ManagedNetworkSettingsRuleOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'ManagedNetworkProvisionsOperations', -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_batch_deployments_operations.py deleted file mode 100644 index 79f792ce46d8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_batch_endpoints_operations.py deleted file mode 100644 index 70dab97e902c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_code_containers_operations.py deleted file mode 100644 index c5ff4c33ad4e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_code_versions_operations.py deleted file mode 100644 index f1de7af3ac9e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_code_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.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 - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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 - - - @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', "2023-06-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/v2023_06_01_preview/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_component_containers_operations.py deleted file mode 100644 index 0e50ab30dd63..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_component_versions_operations.py deleted file mode 100644 index 92880f9568d1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_component_versions_operations.py +++ /dev/null @@ -1,568 +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 - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-06-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"]] - 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}/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') - 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( - 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', "2023-06-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', "2023-06-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', "2023-06-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 - ) - -# 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"]] - stage=None, # type: Optional[str] - **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 - :param stage: Component 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 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', "2023-06-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, - 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, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - 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("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', "2023-06-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', "2023-06-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', "2023-06-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_compute_operations.py deleted file mode 100644 index cb8d81b5d7cf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_compute_operations.py +++ /dev/null @@ -1,1718 +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', "2023-06-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', "2023-06-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', "2023-06-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[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', "2023-06-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[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', "2023-06-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'), - } - - _url = _format_url_section(_url, **path_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', "2023-06-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[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', "2023-06-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', "2023-06-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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 = kwargs.pop('api_version', "2023-06-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', "2023-06-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', "2023-06-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_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', "2023-06-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[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): - """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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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 - - - 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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_data_containers_operations.py deleted file mode 100644 index 27a048ed1c21..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_data_versions_operations.py deleted file mode 100644 index ca5c4e0ebd19..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_data_versions_operations.py +++ /dev/null @@ -1,580 +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 - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-06-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"]] - 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}/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') - 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( - 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', "2023-06-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', "2023-06-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', "2023-06-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 - ) - -# 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"]] - stage=None, # type: Optional[str] - **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 - :param stage: data 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 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', "2023-06-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, - 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, - order_by=order_by, - top=top, - skip=skip, - tags=tags, - list_view_type=list_view_type, - 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("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', "2023-06-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', "2023-06-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', "2023-06-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_datastores_operations.py deleted file mode 100644 index 265aa2d80538..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_datastores_operations.py +++ /dev/null @@ -1,671 +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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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}/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] - _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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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 - **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', {})) - - api_version = kwargs.pop('api_version', "2023-06-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, - name=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('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/v2023_06_01_preview/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_environment_containers_operations.py deleted file mode 100644 index 6700257f57af..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_environment_versions_operations.py deleted file mode 100644 index 2e687d2bb13e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_environment_versions_operations.py +++ /dev/null @@ -1,569 +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 - name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-06-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"]] - 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}/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') - 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( - 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', "2023-06-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', "2023-06-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', "2023-06-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 - ) - -# 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"]] - stage=None, # type: Optional[str] - **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 - :param stage: Stage for including/excluding (for example) archived entities. Takes priority - over listViewType. - :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 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', "2023-06-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, - 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, - order_by=order_by, - top=top, - skip=skip, - list_view_type=list_view_type, - 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("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', "2023-06-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', "2023-06-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', "2023-06-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_features_operations.py deleted file mode 100644 index 87d25eff7be2..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_features_operations.py +++ /dev/null @@ -1,342 +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 - featureset_name, # type: str - featureset_version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-06-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] - - 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') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: 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', "2023-06-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] - **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 - :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', "2023-06-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, - 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, - 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', "2023-06-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/v2023_06_01_preview/operations/_featureset_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_featureset_containers_operations.py deleted file mode 100644 index 25b4997ee1ac..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_featureset_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_featureset_versions_operations.py deleted file mode 100644 index 159db5047a51..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_featureset_versions_operations.py +++ /dev/null @@ -1,1094 +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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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 - ) - - -def build_list_materialization_jobs_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', "2023-06-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - filters = kwargs.pop('filters', None) # type: Optional[str] - feature_window_start = kwargs.pop('feature_window_start', None) # type: Optional[str] - feature_window_end = kwargs.pop('feature_window_end', 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}/listMaterializationJobs") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=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') - if skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if filters is not None: - _query_parameters['filters'] = _SERIALIZER.query("filters", filters, 'str') - if feature_window_start is not None: - _query_parameters['featureWindowStart'] = _SERIALIZER.query("feature_window_start", feature_window_start, 'str') - if feature_window_end is not None: - _query_parameters['featureWindowEnd'] = _SERIALIZER.query("feature_window_end", feature_window_end, '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 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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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.FeaturesetJob"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FeaturesetJob"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-06-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('FeaturesetJob', 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.FeaturesetJob"] - """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 FeaturesetJob or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetJob] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-06-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.FeaturesetJob"] - lro_delay = kwargs.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('FeaturesetJob', 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 - - @distributed_trace - def list_materialization_jobs( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - skip=None, # type: Optional[str] - filters=None, # type: Optional[str] - feature_window_start=None, # type: Optional[str] - feature_window_end=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FeaturesetJobArmPaginatedResult"] - """List materialization Jobs. - - List materialization Jobs. - - :param resource_group_name: The name of the resource group. The name is 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 skip: Continuation token for pagination. - :type skip: str - :param filters: Comma-separated list of tag names (and optionally values). Example: - tag1,tag2=value2. - :type filters: str - :param feature_window_start: Start time of the feature window to filter materialization jobs. - :type feature_window_start: str - :param feature_window_end: End time of the feature window to filter materialization jobs. - :type feature_window_end: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FeaturesetJobArmPaginatedResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetJobArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetJobArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_materialization_jobs_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, - skip=skip, - filters=filters, - feature_window_start=feature_window_start, - feature_window_end=feature_window_end, - template_url=self.list_materialization_jobs.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_materialization_jobs_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, - skip=skip, - filters=filters, - feature_window_start=feature_window_start, - feature_window_end=feature_window_end, - 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("FeaturesetJobArmPaginatedResult", 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_materialization_jobs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/listMaterializationJobs"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_featurestore_entity_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_featurestore_entity_containers_operations.py deleted file mode 100644 index 625848abc757..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_featurestore_entity_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_featurestore_entity_versions_operations.py deleted file mode 100644 index d6f9313494eb..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_jobs_operations.py deleted file mode 100644 index 918ed2054ca1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_jobs_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 - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-06-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"]] - asset_name = kwargs.pop('asset_name', None) # type: Optional[str] - scheduled = kwargs.pop('scheduled', None) # type: Optional[bool] - schedule_id = kwargs.pop('schedule_id', 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 asset_name is not None: - _query_parameters['assetName'] = _SERIALIZER.query("asset_name", asset_name, '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 = kwargs.pop('api_version', "2023-06-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', "2023-06-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_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', "2023-06-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'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[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( - 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', "2023-06-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', "2023-06-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"]] - asset_name=None, # type: Optional[str] - 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 asset_name: Asset name the job's named output is registered with. - :type asset_name: str - :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 - """ - api_version = kwargs.pop('api_version', "2023-06-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, - asset_name=asset_name, - 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, - api_version=api_version, - skip=skip, - job_type=job_type, - tag=tag, - list_view_type=list_view_type, - asset_name=asset_name, - 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( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=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', "2023-06-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', "2023-06-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', "2023-06-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 update( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.PartialJobBasePartialResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.JobBase" - """Updates a Job. - - Updates 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 to apply during the operation. - :type body: ~azure.mgmt.machinelearningservices.models.PartialJobBasePartialResource - :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', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialJobBasePartialResource') - - request = build_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.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('JobBase', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.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. - - 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.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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_labeling_jobs_operations.py deleted file mode 100644 index c2999cc5a2d3..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_labeling_jobs_operations.py +++ /dev/null @@ -1,1044 +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', "2023-06-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - top = kwargs.pop('top', None) # type: Optional[int] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=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 top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, '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_delete_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', "2023-06-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{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', "2023-06-01-preview") # type: str - include_job_instructions = kwargs.pop('include_job_instructions', False) # type: Optional[bool] - include_label_categories = kwargs.pop('include_label_categories', False) # type: Optional[bool] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{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') - if include_job_instructions is not None: - _query_parameters['includeJobInstructions'] = _SERIALIZER.query("include_job_instructions", include_job_instructions, 'bool') - if include_label_categories is not None: - _query_parameters['includeLabelCategories'] = _SERIALIZER.query("include_label_categories", include_label_categories, '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_create_or_update_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', "2023-06-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}/labelingJobs/{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_export_labels_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', "2023-06-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}/labelingJobs/{id}/exportLabels") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=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] - 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_pause_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', "2023-06-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=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 - ) - - -def build_resume_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', "2023-06-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=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 LabelingJobsOperations(object): - """LabelingJobsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.machinelearningservices.models - :param client: Client for service requests. - :param config: Configuration 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] - top=None, # type: Optional[int] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.LabelingJobResourceArmPaginatedResult"] - """Lists labeling jobs in the workspace. - - Lists labeling 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 top: Number of labeling jobs to return. - :type top: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LabelingJobResourceArmPaginatedResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] - error_map = { - 401: ClientAuthenticationError, 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, - top=top, - 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, - top=top, - 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("LabelingJobResourceArmPaginatedResult", 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}/labelingJobs"} # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete a labeling job. - - Delete a labeling 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 LabelingJob. - :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', {})) - - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - - - request = build_delete_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.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}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - include_job_instructions=False, # type: Optional[bool] - include_label_categories=False, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> "_models.LabelingJob" - """Gets a labeling job by name/id. - - Gets a labeling 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 LabelingJob. - :type id: str - :param include_job_instructions: Boolean value to indicate whether to include JobInstructions - in response. - :type include_job_instructions: bool - :param include_label_categories: Boolean value to indicate Whether to include LabelCategories - in response. - :type include_label_categories: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LabelingJob, or the result of cls(response) - :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJob - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-06-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, - include_job_instructions=include_job_instructions, - include_label_categories=include_label_categories, - 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('LabelingJob', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.LabelingJob" - **kwargs # type: Any - ): - # type: (...) -> "_models.LabelingJob" - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'LabelingJob') - - request = build_create_or_update_request_initial( - 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_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('LabelingJob', 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('LabelingJob', 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}/labelingJobs/{id}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.LabelingJob" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.LabelingJob"] - """Creates or updates a labeling job (asynchronous). - - Creates or updates a labeling 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 LabelingJob. - :type id: str - :param body: LabelingJob definition object. - :type body: ~azure.mgmt.machinelearningservices.models.LabelingJob - :keyword callable cls: A custom type or function that will be passed the direct response - :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 LabelingJob or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-06-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.LabelingJob"] - lro_delay = kwargs.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, - id=id, - 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('LabelingJob', 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}/labelingJobs/{id}"} # type: ignore - - def _export_labels_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.ExportSummary" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ExportSummary"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExportSummary"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'ExportSummary') - - request = build_export_labels_request_initial( - 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._export_labels_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('ExportSummary', 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 - - _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - - @distributed_trace - def begin_export_labels( - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - body, # type: "_models.ExportSummary" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ExportSummary"] - """Export labels from a labeling job (asynchronous). - - Export labels from a labeling 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 LabelingJob. - :type id: str - :param body: The export summary. - :type body: ~azure.mgmt.machinelearningservices.models.ExportSummary - :keyword callable cls: A custom type or function that will be passed the direct response - :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 ExportSummary or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-06-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.ExportSummary"] - lro_delay = kwargs.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._export_labels_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - id=id, - 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('ExportSummary', 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_export_labels.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - - @distributed_trace - def pause( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Pause a labeling job. - - Pause a labeling 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 LabelingJob. - :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', {})) - - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - - - request = build_pause_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.pause.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, 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, {}) - - pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - - - def _resume_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', "2023-06-01-preview") # type: str - - - request = build_resume_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._resume_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) - - _resume_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore - - - @distributed_trace - def begin_resume( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - workspace_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Resume a labeling job (asynchronous). - - Resume a labeling 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 LabelingJob. - :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', "2023-06-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._resume_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_resume.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_managed_network_provisions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_managed_network_provisions_operations.py deleted file mode 100644 index 4b8bc1f4829c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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: Name of Azure Machine Learning workspace. - :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', "2023-06-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/v2023_06_01_preview/operations/_managed_network_settings_rule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_managed_network_settings_rule_operations.py deleted file mode 100644 index f45a26eb9eaf..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_managed_network_settings_rule_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 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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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: 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 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', "2023-06-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', "2023-06-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')) - - - 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: Name of Azure Machine Learning workspace. - :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', "2023-06-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, **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: Name of Azure Machine Learning workspace. - :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', "2023-06-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', "2023-06-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: Name of Azure Machine Learning workspace. - :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', "2023-06-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/v2023_06_01_preview/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_model_containers_operations.py deleted file mode 100644 index 71264c245214..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_model_versions_operations.py deleted file mode 100644 index 2ea22fc8c398..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_model_versions_operations.py +++ /dev/null @@ -1,812 +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', "2023-06-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"]] - 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}/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') - 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( - 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', "2023-06-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', "2023-06-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', "2023-06-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_package_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', "2023-06-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}/package") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=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="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"]] - stage=None, # type: Optional[str] - **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 - :param stage: Model 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 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', "2023-06-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, - 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, - order_by=order_by, - top=top, - version=version, - description=description, - offset=offset, - tags=tags, - properties=properties, - feed=feed, - list_view_type=list_view_type, - 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("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', "2023-06-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', "2023-06-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', "2023-06-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 _package_initial( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.PackageRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.PackageResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PackageRequest') - - request = build_package_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._package_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('PackageResponse', 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 - - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore - - - @distributed_trace - def begin_package( - self, - resource_group_name, # type: str - workspace_name, # type: str - name, # type: str - version, # type: str - body, # type: "_models.PackageRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.PackageResponse"] - """Model Version Package operation. - - Model Version Package 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 name: Container name. This is case-sensitive. - :type name: str - :param version: Version identifier. This is case-sensitive. - :type version: str - :param body: Package operation request body. - :type body: ~azure.mgmt.machinelearningservices.models.PackageRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :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 PackageResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-06-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.PackageResponse"] - lro_delay = kwargs.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._package_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('PackageResponse', 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_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_online_deployments_operations.py deleted file mode 100644 index 2ef129b7051e..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_online_endpoints_operations.py deleted file mode 100644 index 7932b349e672..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_operations.py deleted file mode 100644 index f05bde6b9cb0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_operations.py +++ /dev/null @@ -1,156 +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', "2023-06-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.AmlOperationListResult"] - """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 AmlOperationListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlOperationListResult"] - error_map = { - 401: ClientAuthenticationError, 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("AmlOperationListResult", 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/v2023_06_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index da12b8249e74..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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: 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 - """ - api_version = kwargs.pop('api_version', "2023-06-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: Name of Azure Machine Learning workspace. - :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', "2023-06-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: Name of Azure Machine Learning workspace. - :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', "2023-06-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: Name of Azure Machine Learning workspace. - :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', "2023-06-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/v2023_06_01_preview/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_private_link_resources_operations.py deleted file mode 100644 index ec0db652263c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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: 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 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', "2023-06-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/v2023_06_01_preview/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_quotas_operations.py deleted file mode 100644 index 15bc47c04089..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_registries_operations.py deleted file mode 100644 index 2717d292e17b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_registry_code_containers_operations.py deleted file mode 100644 index 0ec8ad877c44..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_registry_code_versions_operations.py deleted file mode 100644 index 389f2150f492..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_registry_component_containers_operations.py deleted file mode 100644 index 55f7008eeb9f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_registry_component_versions_operations.py deleted file mode 100644 index 6f1c807270fa..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_registry_component_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 - component_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-06-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] - 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/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') - 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 - registry_name, # type: str - component_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-06-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', "2023-06-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', "2023-06-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] - stage=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 - :param stage: Component 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 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', "2023-06-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, - 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, - registry_name=registry_name, - component_name=component_name, - api_version=api_version, - order_by=order_by, - top=top, - skip=skip, - 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("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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_registry_data_containers_operations.py deleted file mode 100644 index b71bfb134270..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_registry_data_versions_operations.py deleted file mode 100644 index 5e6d2b38b94b..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_registry_environment_containers_operations.py deleted file mode 100644 index 3d50fb87236f..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_registry_environment_versions_operations.py deleted file mode 100644 index e6c6d56f182c..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_registry_environment_versions_operations.py +++ /dev/null @@ -1,699 +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', "2023-06-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"]] - 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/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') - 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 - registry_name, # type: str - environment_name, # type: str - version, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-06-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', "2023-06-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', "2023-06-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"]] - stage=None, # type: Optional[str] - **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 - :param stage: Stage for including/excluding (for example) archived entities. Takes priority - over listViewType. - :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 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', "2023-06-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, - 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, - 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, - 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("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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_registry_model_containers_operations.py deleted file mode 100644 index 545b09faa9ec..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_registry_model_versions_operations.py deleted file mode 100644 index e07650f721e4..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_registry_model_versions_operations.py +++ /dev/null @@ -1,1036 +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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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_package_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', "2023-06-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}/package") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("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 - ) - - -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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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 - - def _package_initial( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.PackageRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.PackageResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PackageRequest') - - request = build_package_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._package_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('PackageResponse', 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 - - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package"} # type: ignore - - - @distributed_trace - def begin_package( - self, - resource_group_name, # type: str - registry_name, # type: str - model_name, # type: str - version, # type: str - body, # type: "_models.PackageRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.PackageResponse"] - """Model Version Package operation. - - Model Version Package operation. - - :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 - :param body: Package operation request body. - :type body: ~azure.mgmt.machinelearningservices.models.PackageRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :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 PackageResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-06-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.PackageResponse"] - lro_delay = kwargs.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._package_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('PackageResponse', 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_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package"} # 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', "2023-06-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/v2023_06_01_preview/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_schedules_operations.py deleted file mode 100644 index 792e71bfc895..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_usages_operations.py deleted file mode 100644 index 6dfcebcb2ef1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_virtual_machine_sizes_operations.py deleted file mode 100644 index 139be86c7ab5..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_workspace_connections_operations.py deleted file mode 100644 index abc4094f6b32..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_workspace_connections_operations.py +++ /dev/null @@ -1,742 +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', "2023-06-01-preview") # type: str - target = kwargs.pop('target', None) # type: Optional[str] - category = kwargs.pop('category', None) # type: Optional[str] - - 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') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: 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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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 - ) - -# 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] - **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: 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 - """ - api_version = kwargs.pop('api_version', "2023-06-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, - 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, - 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: 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', {})) - - api_version = kwargs.pop('api_version', "2023-06-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: 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', {})) - - api_version = kwargs.pop('api_version', "2023-06-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: Name of Azure Machine Learning workspace. - :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', "2023-06-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: Name of Azure Machine Learning workspace. - :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', "2023-06-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: 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', {})) - - api_version = kwargs.pop('api_version', "2023-06-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 - diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_workspace_features_operations.py deleted file mode 100644 index f8dc8cfca1e1..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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', "2023-06-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', "2023-06-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/v2023_06_01_preview/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_workspaces_operations.py deleted file mode 100644 index fd9c6eb687d0..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_workspaces_operations.py +++ /dev/null @@ -1,1901 +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', "2023-06-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - kind = kwargs.pop('kind', 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 skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if kind is not None: - _query_parameters['kind'] = _SERIALIZER.query("kind", kind, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: 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', "2023-06-01-preview") # type: str - skip = kwargs.pop('skip', None) # type: Optional[str] - kind = kwargs.pop('kind', 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 skip is not None: - _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') - if kind is not None: - _query_parameters['kind'] = _SERIALIZER.query("kind", kind, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: 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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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', "2023-06-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, - skip=None, # type: Optional[str] - kind=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 skip: Continuation token for pagination. - :type skip: str - :param kind: Kind of workspace. - :type kind: 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', "2023-06-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, - skip=skip, - kind=kind, - 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, - skip=skip, - kind=kind, - 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 - skip=None, # type: Optional[str] - kind=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 skip: Continuation token for pagination. - :type skip: str - :param kind: Kind of workspace. - :type kind: 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', "2023-06-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, - skip=skip, - kind=kind, - 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, - skip=skip, - kind=kind, - 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', "2023-06-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) - - 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( # 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: Name of Azure Machine Learning workspace. - :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', "2023-06-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, **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: 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', {})) - - api_version = kwargs.pop('api_version', "2023-06-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', "2023-06-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: Name of Azure Machine Learning workspace. - :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', "2023-06-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', "2023-06-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: Name of Azure Machine Learning workspace. - :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', "2023-06-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', "2023-06-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: Name of Azure Machine Learning workspace. - :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', "2023-06-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: 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', {})) - - api_version = kwargs.pop('api_version', "2023-06-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: 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', {})) - - api_version = kwargs.pop('api_version', "2023-06-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: 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', {})) - - api_version = kwargs.pop('api_version', "2023-06-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: 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', {})) - - api_version = kwargs.pop('api_version', "2023-06-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: 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', {})) - - api_version = kwargs.pop('api_version', "2023-06-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', "2023-06-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: 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 - """ - api_version = kwargs.pop('api_version', "2023-06-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', "2023-06-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: 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 - """ - api_version = kwargs.pop('api_version', "2023-06-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/v2023_06_01_preview/py.typed b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_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/_datastore/_on_prem.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_datastore/_on_prem.py index 1f0a9710dc32..b4d1baf06d5c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_datastore/_on_prem.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_datastore/_on_prem.py @@ -8,7 +8,6 @@ from marshmallow import fields, post_load -from azure.ai.ml._restclient.v2022_10_01_preview.models import DatastoreType from azure.ai.ml._schema.core.fields import NestedField, PathAwareSchema, StringTransformedEnum, UnionField from azure.ai.ml._utils.utils import camel_to_snake @@ -19,7 +18,9 @@ class HdfsSchema(PathAwareSchema): name = fields.Str(required=True) id = fields.Str(dump_only=True) type = StringTransformedEnum( - allowed_values=DatastoreType.HDFS, + # "Hdfs" was @removed from the shared arm_ml_service DatastoreType enum (api-version + # 2025-12-01); keep the literal wire value to preserve the on-prem datastore contract. + allowed_values="Hdfs", casing_transform=camel_to_snake, required=True, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_sweep/sweep_sampling_algorithm.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_sweep/sweep_sampling_algorithm.py index 2b8137b41a42..657cc16f43f0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_sweep/sweep_sampling_algorithm.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_sweep/sweep_sampling_algorithm.py @@ -8,7 +8,7 @@ from marshmallow import ValidationError, fields, post_load, pre_dump -from azure.ai.ml._restclient.v2023_02_01_preview.models import RandomSamplingAlgorithmRule, SamplingAlgorithmType +from azure.ai.ml._restclient.arm_ml_service.models import RandomSamplingAlgorithmRule, SamplingAlgorithmType from azure.ai.ml._schema.core.fields import StringTransformedEnum, UnionField 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/_schema/component/automl_component.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/automl_component.py index aef98ccaae62..31e1050bff76 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/automl_component.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/automl_component.py @@ -1,7 +1,7 @@ # --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -from azure.ai.ml._restclient.v2022_10_01_preview.models import TaskType +from azure.ai.ml._restclient.arm_ml_service.models import TaskType from azure.ai.ml._schema.component.component import ComponentSchema from azure.ai.ml._schema.core.fields import StringTransformedEnum from azure.ai.ml._utils.utils import camel_to_snake diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/compute/schedule.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/compute/schedule.py index 49f41edf9ad9..9da6d1e3e7fd 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/compute/schedule.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/compute/schedule.py @@ -7,9 +7,9 @@ from marshmallow import fields from marshmallow.decorators import post_load -from azure.ai.ml._restclient.v2022_10_01_preview.models import ComputePowerAction, RecurrenceFrequency -from azure.ai.ml._restclient.v2022_10_01_preview.models import ScheduleStatus as ScheduleState -from azure.ai.ml._restclient.v2022_10_01_preview.models import TriggerType, WeekDay +from azure.ai.ml._restclient.arm_ml_service.models import ComputePowerAction, RecurrenceFrequency +from azure.ai.ml._restclient.arm_ml_service.models import ScheduleStatus as ScheduleState +from azure.ai.ml._restclient.arm_ml_service.models import TriggerType, WeekDay from azure.ai.ml._schema.core.fields import NestedField, StringTransformedEnum, UnionField from azure.ai.ml._schema.core.schema_meta import PatchedSchemaMeta diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/compute/usage.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/compute/usage.py index 4860946bce99..36b3cf4a03f0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/compute/usage.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/compute/usage.py @@ -7,7 +7,7 @@ from marshmallow import fields from marshmallow.decorators import post_load -from azure.ai.ml._restclient.v2022_10_01_preview.models import UsageUnit +from azure.ai.ml._restclient.arm_ml_service.models import UsageUnit from azure.ai.ml._schema.core.fields import NestedField, StringTransformedEnum, UnionField from azure.ai.ml._schema.core.schema_meta import PatchedSchemaMeta from azure.ai.ml._utils.utils import camel_to_snake diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/schedule/trigger.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/schedule/trigger.py index 37147d4884fc..a9b2943ecb45 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/schedule/trigger.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/schedule/trigger.py @@ -4,7 +4,7 @@ from marshmallow import fields, post_dump, post_load -from azure.ai.ml._restclient.v2022_10_01_preview.models import RecurrenceFrequency, TriggerType, WeekDay +from azure.ai.ml._restclient.arm_ml_service.models import RecurrenceFrequency, TriggerType, WeekDay from azure.ai.ml._schema.core.fields import ( DateTimeStr, DumpableIntegerField, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/__init__.py index 0e29a05abb71..7e02eec61370 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/__init__.py @@ -13,7 +13,7 @@ from typing import Any, Optional from azure.ai.ml._restclient.arm_ml_service.models import CreatedByType -from azure.ai.ml._restclient.v2022_10_01_preview.models import UsageUnit +from azure.ai.ml._restclient.arm_ml_service.models import UsageUnit from ._assets._artifacts._package.base_environment_source import BaseEnvironment from ._assets._artifacts._package.inferencing_server import ( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/inferencing_server.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/inferencing_server.py index 6e685244fc08..659b0f2d6cc6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/inferencing_server.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/inferencing_server.py @@ -6,15 +6,12 @@ from typing import Any, Optional -from azure.ai.ml._restclient.v2023_02_01_preview.models import ( - AzureMLOnlineInferencingServer as RestAzureMLOnlineInferencingServer, -) -from azure.ai.ml._restclient.v2023_02_01_preview.models import CustomInferencingServer as RestCustomInferencingServer -from azure.ai.ml._restclient.v2023_02_01_preview.models import ( +from azure.ai.ml._restclient.v2023_08_01_preview.models import CustomInferencingServer as RestCustomInferencingServer +from azure.ai.ml._restclient.v2023_08_01_preview.models import ( OnlineInferenceConfiguration as RestOnlineInferenceConfiguration, ) -from azure.ai.ml._restclient.v2023_02_01_preview.models import Route as RestRoute -from azure.ai.ml._restclient.v2023_02_01_preview.models import TritonInferencingServer as RestTritonInferencingServer +from azure.ai.ml._restclient.v2023_08_01_preview.models import Route as RestRoute +from azure.ai.ml._restclient.v2023_08_01_preview.models import TritonInferencingServer as RestTritonInferencingServer from azure.ai.ml._restclient.v2023_08_01_preview.models import ( AzureMLBatchInferencingServer as RestAzureMLBatchInferencingServer, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/data_transfer.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/data_transfer.py index 62833dd4a97a..38f0012872b9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/data_transfer.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/data_transfer.py @@ -9,7 +9,7 @@ from marshmallow import Schema -from azure.ai.ml._restclient.v2022_10_01_preview.models import JobBase +from azure.ai.ml._restclient.arm_ml_service.models import JobBase from azure.ai.ml._schema.job.data_transfer_job import ( DataTransferCopyJobSchema, DataTransferExportJobSchema, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_aml_compute_node_info.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_aml_compute_node_info.py index 823a89ca685a..a66d2941cf16 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_aml_compute_node_info.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_aml_compute_node_info.py @@ -4,7 +4,7 @@ from typing import Dict, Optional -from azure.ai.ml._restclient.v2022_10_01_preview.models import AmlComputeNodeInformation +from azure.ai.ml._restclient.arm_ml_service.models import AmlComputeNodeInformation from azure.ai.ml._schema.compute.aml_compute_node_info import AmlComputeNodeInfoSchema from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_custom_applications.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_custom_applications.py index 2ee65e7ff037..fd8ea38f5946 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_custom_applications.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_custom_applications.py @@ -5,15 +5,15 @@ from typing import Any, Dict, List, Optional -from azure.ai.ml._restclient.v2022_10_01_preview.models import CustomService, Docker -from azure.ai.ml._restclient.v2022_10_01_preview.models import Endpoint as RestEndpoint -from azure.ai.ml._restclient.v2022_10_01_preview.models import EnvironmentVariable as RestEnvironmentVariable -from azure.ai.ml._restclient.v2022_10_01_preview.models import EnvironmentVariableType as RestEnvironmentVariableType -from azure.ai.ml._restclient.v2022_10_01_preview.models import Image as RestImage -from azure.ai.ml._restclient.v2022_10_01_preview.models import ImageType as RestImageType -from azure.ai.ml._restclient.v2022_10_01_preview.models import Protocol -from azure.ai.ml._restclient.v2022_10_01_preview.models import VolumeDefinition as RestVolumeDefinition -from azure.ai.ml._restclient.v2022_10_01_preview.models import VolumeDefinitionType as RestVolumeDefinitionType +from azure.ai.ml._restclient.arm_ml_service.models import CustomService, Docker +from azure.ai.ml._restclient.arm_ml_service.models import Endpoint as RestEndpoint +from azure.ai.ml._restclient.arm_ml_service.models import EnvironmentVariable as RestEnvironmentVariable +from azure.ai.ml._restclient.arm_ml_service.models import EnvironmentVariableType as RestEnvironmentVariableType +from azure.ai.ml._restclient.arm_ml_service.models import Image as RestImage +from azure.ai.ml._restclient.arm_ml_service.models import ImageType as RestImageType +from azure.ai.ml._restclient.arm_ml_service.models import Protocol +from azure.ai.ml._restclient.arm_ml_service.models import VolumeDefinition as RestVolumeDefinition +from azure.ai.ml._restclient.arm_ml_service.models import VolumeDefinitionType as RestVolumeDefinitionType from azure.ai.ml.constants._compute import DUPLICATE_APPLICATION_ERROR, INVALID_VALUE_ERROR, CustomApplicationDefaults from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, ValidationException @@ -160,15 +160,19 @@ def _to_rest_object(self) -> CustomService: if self.bind_mounts: volumes = [volume._to_rest_object() for volume in self.bind_mounts] - return CustomService( + custom_service = CustomService( name=self.name, image=self.image._to_rest_object(), endpoints=endpoints, environment_variables=environment_variables, volumes=volumes, docker=Docker(privileged=True), - additional_properties={**{"type": self.type}, **self.additional_properties}, ) + # ``type`` and any extra fields are not typed on the arm model; set them as wire fields. + custom_service["type"] = self.type + for key, value in self.additional_properties.items(): + custom_service[key] = value + return custom_service @classmethod def _from_rest_object(cls, obj: CustomService) -> "CustomApplications": @@ -187,14 +191,18 @@ def _from_rest_object(cls, obj: CustomService) -> "CustomApplications": for volume in obj.volumes: bind_mounts.append(VolumeSettings._from_rest_object(volume)) + # ``type`` and extra keys are stored as untyped wire fields on the arm model. + known_wire_fields = {"name", "image", "endpoints", "environmentVariables", "volumes", "docker"} + additional_properties = {key: value for key, value in dict(obj).items() if key not in known_wire_fields} + return CustomApplications( name=obj.name, image=ImageSettings._from_rest_object(obj.image), endpoints=endpoints, environment_variables=environment_variables, bind_mounts=bind_mounts, - type=obj.additional_properties.pop("type", CustomApplicationDefaults.DOCKER), - **obj.additional_properties, + type=additional_properties.pop("type", CustomApplicationDefaults.DOCKER), + **additional_properties, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_schedule.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_schedule.py index 3616a5ccc3d2..1427f5439d28 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_schedule.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_schedule.py @@ -4,11 +4,11 @@ # pylint: disable=protected-access from typing import Any, List, Optional, Union -from azure.ai.ml._restclient.v2022_10_01_preview.models import ComputePowerAction -from azure.ai.ml._restclient.v2022_10_01_preview.models import ComputeSchedules as RestComputeSchedules -from azure.ai.ml._restclient.v2022_10_01_preview.models import ComputeStartStopSchedule as RestComputeStartStopSchedule -from azure.ai.ml._restclient.v2022_10_01_preview.models import ScheduleStatus as ScheduleState -from azure.ai.ml._restclient.v2022_10_01_preview.models import TriggerType +from azure.ai.ml._restclient.arm_ml_service.models import ComputePowerAction +from azure.ai.ml._restclient.arm_ml_service.models import ComputeSchedules as RestComputeSchedules +from azure.ai.ml._restclient.arm_ml_service.models import ComputeStartStopSchedule as RestComputeStartStopSchedule +from azure.ai.ml._restclient.arm_ml_service.models import ScheduleStatus as ScheduleState +from azure.ai.ml._restclient.arm_ml_service.models import TriggerType from azure.ai.ml.entities._mixins import RestTranslatableMixin from .._schedule.trigger import CronTrigger, RecurrencePattern, RecurrenceTrigger diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_setup_scripts.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_setup_scripts.py index d2e12fd4032f..8cf4f5fe1fdf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_setup_scripts.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_setup_scripts.py @@ -6,9 +6,9 @@ import re from typing import Optional, cast -from azure.ai.ml._restclient.v2022_10_01_preview.models import ScriptReference as RestScriptReference -from azure.ai.ml._restclient.v2022_10_01_preview.models import ScriptsToExecute as RestScriptsToExecute -from azure.ai.ml._restclient.v2022_10_01_preview.models import SetupScripts as RestSetupScripts +from azure.ai.ml._restclient.arm_ml_service.models import ScriptReference as RestScriptReference +from azure.ai.ml._restclient.arm_ml_service.models import ScriptsToExecute as RestScriptsToExecute +from azure.ai.ml._restclient.arm_ml_service.models import SetupScripts as RestSetupScripts from azure.ai.ml.entities._mixins import RestTranslatableMixin diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_usage.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_usage.py index 6702382eb624..1b68e02c0eae 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_usage.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_usage.py @@ -6,8 +6,8 @@ from os import PathLike from typing import IO, Any, AnyStr, Dict, Optional, Union -from azure.ai.ml._restclient.v2022_10_01_preview.models import Usage as RestUsage -from azure.ai.ml._restclient.v2022_10_01_preview.models import UsageUnit +from azure.ai.ml._restclient.arm_ml_service.models import Usage as RestUsage +from azure.ai.ml._restclient.arm_ml_service.models import UsageUnit from azure.ai.ml._schema.compute.usage import UsageSchema from azure.ai.ml._utils.utils import dump_yaml_to_file from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_vm_size.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_vm_size.py index 2f0049f0ca47..9ac3e3bc6c62 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_vm_size.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_vm_size.py @@ -6,7 +6,7 @@ from os import PathLike from typing import IO, Any, AnyStr, Dict, List, Optional, Union -from azure.ai.ml._restclient.v2022_10_01_preview.models import VirtualMachineSize +from azure.ai.ml._restclient.arm_ml_service.models import VirtualMachineSize from azure.ai.ml._schema.compute.vm_size import VmSizeSchema from azure.ai.ml._utils.utils import dump_yaml_to_file from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/aml_compute.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/aml_compute.py index 8533c92b1e5e..f0732a52216b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/aml_compute.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/aml_compute.py @@ -6,8 +6,8 @@ from typing import Any, Dict, Optional -from azure.ai.ml._restclient.v2022_12_01_preview.models import AmlCompute as AmlComputeRest -from azure.ai.ml._restclient.v2022_12_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import AmlCompute as AmlComputeRest +from azure.ai.ml._restclient.arm_ml_service.models import ( AmlComputeProperties, ComputeResource, ResourceId, @@ -203,7 +203,11 @@ def _load_from_rest(cls, rest_obj: ComputeResource) -> "AmlCompute": identity=( IdentityConfiguration._from_compute_rest_object(rest_obj.identity) if rest_obj.identity else None ), - created_on=prop.additional_properties.get("createdOn", None), + created_on=( + prop.additional_properties.get("createdOn", None) + if hasattr(prop, "additional_properties") + else prop.get("createdOn") if hasattr(prop, "get") else None + ), enable_node_public_ip=( prop.properties.enable_node_public_ip if prop.properties.enable_node_public_ip is not None else True ), @@ -260,6 +264,10 @@ def _to_rest_object(self) -> ComputeResource: remote_login_port_public_access=remote_login_public_access, enable_node_public_ip=self.enable_node_public_ip, ) + # osType defaulted to "Linux" on the legacy 2022-12-01-preview model and was serialized on the + # wire; it was @removed from the shared arm_ml_service model (api-version 2025-12-01). Set it via + # its wire key to preserve the old wire body. + aml_prop["osType"] = "Linux" aml_comp = AmlComputeRest( description=self.description, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/compute.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/compute.py index aa2cbedda5b5..c906ebc252a9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/compute.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/compute.py @@ -9,7 +9,7 @@ from pathlib import Path from typing import IO, Any, AnyStr, Dict, Optional, Union, cast -from azure.ai.ml._restclient.v2022_10_01_preview.models import ComputeResource +from azure.ai.ml._restclient.arm_ml_service.models import ComputeResource from azure.ai.ml._schema.compute.compute import ComputeSchema from azure.ai.ml._utils.utils import dump_yaml_to_file from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY, CommonYamlFields diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/compute_instance.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/compute_instance.py index 5117a9d4a8bf..71ba686bf050 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/compute_instance.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/compute_instance.py @@ -9,11 +9,11 @@ import warnings from typing import Any, Dict, List, Optional -from azure.ai.ml._restclient.v2022_10_01_preview.models import AssignedUser -from azure.ai.ml._restclient.v2023_08_01_preview.models import ComputeInstance as CIRest -from azure.ai.ml._restclient.v2023_08_01_preview.models import ComputeInstanceProperties -from azure.ai.ml._restclient.v2023_08_01_preview.models import ComputeInstanceSshSettings as CiSShSettings -from azure.ai.ml._restclient.v2023_08_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import AssignedUser +from azure.ai.ml._restclient.arm_ml_service.models import ComputeInstance as CIRest +from azure.ai.ml._restclient.arm_ml_service.models import ComputeInstanceProperties +from azure.ai.ml._restclient.arm_ml_service.models import ComputeInstanceSshSettings as CiSShSettings +from azure.ai.ml._restclient.arm_ml_service.models import ( ComputeResource, PersonalComputeInstanceSettings, ResourceId, @@ -35,6 +35,31 @@ module_logger = logging.getLogger(__name__) +def _read_optional_compute_prop(properties: Any, attr_name: str, wire_key: str) -> Any: + """Read a compute property that is a typed attribute on the msrest 2023-08 response model but an + untyped wire key on the arm_ml_service hybrid model. + + ``enableRootAccess`` / ``releaseQuotaOnStop`` / ``enableOSPatching`` are declared on the + 2023-08-01-preview swagger (so the real GET/list response, deserialized by the v2023_08 msrest + client, exposes them as snake_case attributes) but were not declared on the shared arm_ml_service + model (so the entity's own ``_to_rest_object()`` round-trip stores them only as camelCase wire + keys). Read the typed attribute first, then fall back to the wire key. + + :param properties: The compute ``properties`` object (msrest or arm hybrid). + :type properties: Any + :param attr_name: The snake_case attribute name on the msrest model. + :type attr_name: str + :param wire_key: The camelCase wire key on the arm hybrid model. + :type wire_key: str + :return: The property value, or None if absent on both. + :rtype: Any + """ + value = getattr(properties, attr_name, None) + if value is None and hasattr(properties, "get"): + value = properties.get(wire_key) + return value + + class ComputeInstanceSshSettings: """Credentials for an administrator user account to SSH into the compute node. @@ -317,10 +342,17 @@ def _to_rest_object(self) -> ComputeResource: idle_time_before_shutdown=idle_time_before_shutdown, enable_node_public_ip=self.enable_node_public_ip, enable_sso=self.enable_sso, - enable_root_access=self.enable_root_access, - release_quota_on_stop=self.release_quota_on_stop, - enable_os_patching=self.enable_os_patching, ) + # enableRootAccess / releaseQuotaOnStop / enableOSPatching are in the 2023-08-01-preview swagger + # and were serialized by the legacy model, but were @removed from the shared arm_ml_service model + # (generated at api-version 2025-12-01). Set them via their wire keys to preserve the old wire. + compute_instance_prop["enableRootAccess"] = self.enable_root_access + compute_instance_prop["releaseQuotaOnStop"] = self.release_quota_on_stop + compute_instance_prop["enableOSPatching"] = self.enable_os_patching + # applicationSharingPolicy / computeInstanceAuthorizationType defaulted to "Shared" / "personal" + # on the legacy model and were serialized; preserve those defaults on the wire. + compute_instance_prop["applicationSharingPolicy"] = "Shared" + compute_instance_prop["computeInstanceAuthorizationType"] = "personal" compute_instance_prop.schedules = self.schedules._to_rest_object() if self.schedules else None compute_instance_prop.setup_scripts = self.setup_scripts._to_rest_object() if self.setup_scripts else None if self.custom_applications: @@ -423,6 +455,21 @@ def _load_from_rest(cls, rest_obj: ComputeResource) -> "ComputeInstance": custom_applications = [] for app in prop.properties.custom_services: custom_applications.append(CustomApplications._from_rest_object(app)) + root_access = ( + _read_optional_compute_prop(prop.properties, "enable_root_access", "enableRootAccess") + if prop.properties + else None + ) + release_quota = ( + _read_optional_compute_prop(prop.properties, "release_quota_on_stop", "releaseQuotaOnStop") + if prop.properties + else None + ) + os_patching = ( + _read_optional_compute_prop(prop.properties, "enable_os_patching", "enableOSPatching") + if prop.properties + else None + ) response = ComputeInstance( name=rest_obj.name, id=rest_obj.id, @@ -482,21 +529,9 @@ def _load_from_rest(cls, rest_obj: ComputeResource) -> "ComputeInstance": enable_sso=( prop.properties.enable_sso if (prop.properties and prop.properties.enable_sso is not None) else True ), - enable_root_access=( - prop.properties.enable_root_access - if (prop.properties and prop.properties.enable_root_access is not None) - else True - ), - release_quota_on_stop=( - prop.properties.release_quota_on_stop - if (prop.properties and prop.properties.release_quota_on_stop is not None) - else False - ), - enable_os_patching=( - prop.properties.enable_os_patching - if (prop.properties and prop.properties.enable_os_patching is not None) - else False - ), + enable_root_access=(root_access if root_access is not None else True), + release_quota_on_stop=(release_quota if release_quota is not None else False), + enable_os_patching=(os_patching if os_patching is not None else False), ) return response diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/kubernetes_compute.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/kubernetes_compute.py index bc8c2c28f055..7b9874f3d868 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/kubernetes_compute.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/kubernetes_compute.py @@ -6,7 +6,7 @@ from typing import Any, Dict, Optional -from azure.ai.ml._restclient.v2022_10_01_preview.models import ComputeResource, Kubernetes, KubernetesProperties +from azure.ai.ml._restclient.arm_ml_service.models import ComputeResource, Kubernetes, KubernetesProperties from azure.ai.ml._schema.compute.kubernetes_compute import KubernetesComputeSchema from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, TYPE from azure.ai.ml.constants._compute import ComputeType @@ -88,7 +88,7 @@ def _load_from_dict(cls, data: Dict, context: Dict, **kwargs: Any) -> "Kubernete return KubernetesCompute(**loaded_data) def _to_rest_object(self) -> ComputeResource: - kubernetes_prop = KubernetesProperties.from_dict(self.properties) + kubernetes_prop = KubernetesProperties(self.properties) kubernetes_prop.namespace = self.namespace kubernetes_comp = Kubernetes( resource_id=self.resource_id, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/synapsespark_compute.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/synapsespark_compute.py index c64c47a731a2..6d87e34b264d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/synapsespark_compute.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/synapsespark_compute.py @@ -3,7 +3,7 @@ # --------------------------------------------------------- from typing import Any, Dict, Optional -from azure.ai.ml._restclient.v2022_10_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( AutoPauseProperties, AutoScaleProperties, ComputeResource, @@ -213,7 +213,6 @@ def _load_from_dict(cls, data: Dict, context: Dict, **kwargs: Any) -> "SynapseSp def _to_rest_object(self) -> ComputeResource: synapsespark_comp = SynapseSpark( - name=self.name, compute_type=self.type, resource_id=self.resource_id, description=self.description, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/unsupported_compute.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/unsupported_compute.py index 258fbf6bed6c..131146c0c0c7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/unsupported_compute.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/unsupported_compute.py @@ -3,7 +3,7 @@ # --------------------------------------------------------- from typing import Any, Dict -from azure.ai.ml._restclient.v2022_10_01_preview.models import ComputeResource +from azure.ai.ml._restclient.arm_ml_service.models import ComputeResource from azure.ai.ml.constants._common import TYPE from azure.ai.ml.entities._compute.compute import Compute from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, ValidationException diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/virtual_machine_compute.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/virtual_machine_compute.py index 90c3ec6302f7..6668d0bf1aaf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/virtual_machine_compute.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/virtual_machine_compute.py @@ -4,9 +4,9 @@ from pathlib import Path from typing import Any, Dict, Optional -from azure.ai.ml._restclient.v2022_10_01_preview.models import ComputeResource -from azure.ai.ml._restclient.v2022_10_01_preview.models import VirtualMachine as VMResource -from azure.ai.ml._restclient.v2022_10_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ComputeResource +from azure.ai.ml._restclient.arm_ml_service.models import VirtualMachine as VMResource +from azure.ai.ml._restclient.arm_ml_service.models import ( VirtualMachineSchemaProperties, VirtualMachineSshCredentials, ) 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 8cbb1a3ba7e3..9299fa232d96 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 @@ -7,8 +7,10 @@ from abc import ABC from typing import Any, Dict, List, Optional, Type, Union +from typing_extensions import TypeAlias + from azure.ai.ml._azure_environments import _get_active_directory_url_from_metadata -from azure.ai.ml._restclient.v2022_10_01_preview.models import ManagedServiceIdentity as RestIdentityConfiguration +from azure.ai.ml._restclient.arm_ml_service.models import ManagedServiceIdentity as RestIdentityConfiguration from azure.ai.ml._restclient.arm_ml_service.models import ( WorkspaceConnectionManagedIdentity as RestWorkspaceConnectionManagedIdentity, ) @@ -21,16 +23,10 @@ from azure.ai.ml._restclient.arm_ml_service.models import ( WorkspaceConnectionSharedAccessSignature as RestWorkspaceConnectionSharedAccessSignature, ) -from azure.ai.ml._restclient.v2022_10_01_preview.models import UserAssignedIdentity as RestUserAssignedIdentity +from azure.ai.ml._restclient.arm_ml_service.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, -) -from azure.ai.ml._restclient.arm_ml_service.models import ( - UserAssignedIdentity as RestUserAssignedIdentityConfiguration, -) from azure.ai.ml._restclient.v2023_04_01_preview.models import ( AccountKeyDatastoreCredentials as RestAccountKeyDatastoreCredentials, ) @@ -59,7 +55,7 @@ from azure.ai.ml._restclient.v2023_04_01_preview.models import ( WorkspaceConnectionAccessKey as RestWorkspaceConnectionAccessKey, ) -from azure.ai.ml._restclient.v2023_06_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( WorkspaceConnectionApiKey as RestWorkspaceConnectionApiKey, ) @@ -85,6 +81,12 @@ from azure.ai.ml.entities._mixins import DictMixin, RestTranslatableMixin, YamlTranslatableMixin from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, JobException, ValidationErrorType, ValidationException +# arm_ml_service unifies these into single models; keep legacy alias names for usage sites. Annotate as +# ``TypeAlias`` so mypy treats them as valid types in annotations (a bare ``X = Y`` re-alias of an +# imported name is otherwise seen as a variable, not a type). +RestManagedServiceIdentityConfiguration: TypeAlias = RestIdentityConfiguration +RestUserAssignedIdentityConfiguration: TypeAlias = RestUserAssignedIdentity + class _BaseIdentityConfiguration(ABC, DictMixin, RestTranslatableMixin): def __init__(self) -> None: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/data_import.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/data_import.py index 028d431c1698..4e9d33502fa2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/data_import.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/data_import.py @@ -6,9 +6,9 @@ from pathlib import Path from typing import Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2023_06_01_preview.models import DatabaseSource as RestDatabaseSource -from azure.ai.ml._restclient.v2023_06_01_preview.models import DataImport as RestDataImport -from azure.ai.ml._restclient.v2023_06_01_preview.models import FileSystemSource as RestFileSystemSource +from azure.ai.ml._restclient.v2023_08_01_preview.models import DatabaseSource as RestDatabaseSource +from azure.ai.ml._restclient.v2023_08_01_preview.models import DataImport as RestDataImport +from azure.ai.ml._restclient.v2023_08_01_preview.models import FileSystemSource as RestFileSystemSource from azure.ai.ml._schema import DataImportSchema from azure.ai.ml._utils._experimental import experimental from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY, AssetTypes diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/schedule.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/schedule.py index 6a51878a9590..30a1dbb7ead2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/schedule.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data_import/schedule.py @@ -6,9 +6,9 @@ from pathlib import Path from typing import Any, Dict, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import ImportDataAction -from azure.ai.ml._restclient.v2023_04_01_preview.models import Schedule as RestSchedule -from azure.ai.ml._restclient.v2023_04_01_preview.models import ScheduleProperties +from azure.ai.ml._restclient.arm_ml_service.models import Schedule as RestSchedule +from azure.ai.ml._restclient.arm_ml_service.models import ScheduleProperties +from azure.ai.ml._restclient.v2023_08_01_preview.models import DataImport as RestDataImport from azure.ai.ml._schema._data_import.schedule import ImportDataScheduleSchema from azure.ai.ml._utils._experimental import experimental from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY, ScheduleType @@ -88,9 +88,18 @@ def _create_schema_for_validation(cls, context: Any) -> ImportDataScheduleSchema @classmethod def _from_rest_object(cls, obj: RestSchedule) -> "ImportDataSchedule": + # ``ImportDataAction`` is not in arm_ml_service, so the action is carried as a plain wire dict + # (camelCase keys); read it via mapping access and rehydrate the v2023_08 msrest ``DataImport`` + # model so ``DataImport._from_rest_object`` keeps its typed attribute access. The trigger is a + # present arm model. + action = obj.properties.action + data_import_definition = action["dataImportDefinition"] if action is not None else None + rest_data_import = ( + RestDataImport.deserialize(data_import_definition) if data_import_definition is not None else None + ) return cls( trigger=TriggerBase._from_rest_object(obj.properties.trigger), - import_data=DataImport._from_rest_object(obj.properties.action.data_import_definition), + import_data=DataImport._from_rest_object(rest_data_import), name=obj.name, display_name=obj.properties.display_name, description=obj.properties.description, @@ -102,14 +111,21 @@ def _from_rest_object(cls, obj: RestSchedule) -> "ImportDataSchedule": ) def _to_rest_object(self) -> RestSchedule: - return RestSchedule( + # ``ImportDataAction`` / ``DataImport`` are not in arm_ml_service; build the shared arm Schedule + # envelope and emit the import-data action as a plain wire dict (JSON-direct). ``data_import`` + # serializes to a v2023_08 msrest model whose ``.serialize()`` yields the camelCase wire body. + rest_schedule = RestSchedule( properties=ScheduleProperties( description=self.description, properties=self.properties, tags=self.tags, - action=ImportDataAction(data_import_definition=self.import_data._to_rest_object()), display_name=self.display_name, is_enabled=self._is_enabled, trigger=self.trigger._to_rest_object() if self.trigger is not None else None, ) ) + rest_schedule.properties["action"] = { + "actionType": "ImportData", + "dataImportDefinition": self.import_data._to_rest_object().serialize(), + } + return rest_schedule diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/alert_notification.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/alert_notification.py index 2df0d055edb4..cfe898c418d7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/alert_notification.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/alert_notification.py @@ -2,13 +2,9 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -from typing import List, Optional +from typing import Any, Dict, List, Optional -from azure.ai.ml._restclient.v2023_06_01_preview.models import ( - EmailMonitoringAlertNotificationSettings, - EmailNotificationEnableType, - NotificationSetting, -) +from azure.ai.ml._restclient.arm_ml_service.models import EmailNotificationEnableType, NotificationSetting from azure.ai.ml.entities._mixins import RestTranslatableMixin @@ -38,17 +34,27 @@ def __init__( def _to_rest_object( self, - ) -> EmailMonitoringAlertNotificationSettings: - return EmailMonitoringAlertNotificationSettings( - email_notification_setting=NotificationSetting( + ) -> Dict: + # ``EmailMonitoringAlertNotificationSettings`` does not exist in the shared arm_ml_service model. The + # 2023-06-01-preview wire wraps the email setting in a polymorphic ``alertNotificationType`` ("Email") + # envelope, so build that envelope as a plain dict around the (still present) ``NotificationSetting`` model. + return { + "alertNotificationType": "Email", + "emailNotificationSetting": NotificationSetting( emails=self.emails, email_on=[ EmailNotificationEnableType.JOB_FAILED, EmailNotificationEnableType.JOB_COMPLETED, ], - ) - ) + ), + } @classmethod - def _from_rest_object(cls, obj: EmailMonitoringAlertNotificationSettings) -> "AlertNotification": - return cls(emails=obj.email_notification_setting.emails) + def _from_rest_object(cls, obj: Any) -> "AlertNotification": + # ``obj`` is the arm-hybrid / dict ``alertNotificationSetting`` envelope. Read the nested email setting via + # mapping-or-attribute access to support both shapes. + email_setting = obj["emailNotificationSetting"] if "emailNotificationSetting" in obj else None + emails = None + if email_setting is not None: + emails = email_setting["emails"] if "emails" in email_setting else None + return cls(emails=emails) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/compute.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/compute.py index ff91a8149a41..97d9c53efa1d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/compute.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/compute.py @@ -3,7 +3,7 @@ # --------------------------------------------------------- from azure.ai.ml._exception_helper import log_and_raise_error -from azure.ai.ml._restclient.v2023_06_01_preview.models import AmlTokenComputeIdentity, MonitorServerlessSparkCompute +from azure.ai.ml._restclient.arm_ml_service.models import AmlTokenComputeIdentity, MonitorServerlessSparkCompute from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, ValidationErrorType, ValidationException diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/definition.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/definition.py index be92f799aa8f..2c612bcf8558 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/definition.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/definition.py @@ -8,8 +8,7 @@ from typing_extensions import Literal -from azure.ai.ml._restclient.v2023_06_01_preview.models import AzMonMonitoringAlertNotificationSettings -from azure.ai.ml._restclient.v2023_06_01_preview.models import MonitorDefinition as RestMonitorDefinition +from azure.ai.ml._restclient.arm_ml_service.models import MonitorDefinition as RestMonitorDefinition from azure.ai.ml.constants._monitoring import ( AZMONITORING, DEFAULT_DATA_DRIFT_SIGNAL_NAME, @@ -94,7 +93,9 @@ def _to_rest_object(self, **kwargs: Any) -> RestMonitorDefinition: rest_alert_notification = None if self.alert_notification: if isinstance(self.alert_notification, str) and self.alert_notification.lower() == AZMONITORING: - rest_alert_notification = AzMonMonitoringAlertNotificationSettings() + # ``AzMonMonitoringAlertNotificationSettings`` does not exist in the shared arm_ml_service model; + # build the 2023-06-01-preview polymorphic envelope directly. + rest_alert_notification = {"alertNotificationType": "AzureMonitor"} else: if not isinstance(self.alert_notification, str): rest_alert_notification = self.alert_notification._to_rest_object() @@ -107,14 +108,16 @@ def _to_rest_object(self, **kwargs: Any) -> RestMonitorDefinition: ) for signal_name, signal in self.monitoring_signals.items() } - return RestMonitorDefinition( + rest_definition = RestMonitorDefinition( compute_configuration=self.compute._to_rest_object(), monitoring_target=self.monitoring_target._to_rest_object() if self.monitoring_target else None, signals=_signals, # pylint: disable=possibly-used-before-assignment - # TypeSpec model uses alert_notification_settings (plural), old autorest uses singular - alert_notification_settings=rest_alert_notification, - alert_notification_setting=rest_alert_notification, ) + # The arm_ml_service ``MonitorDefinition`` field serializes to ``alertNotificationSettings`` (plural), but + # the 2023-06-01-preview wire expects the singular ``alertNotificationSetting``. Set the wire key directly. + if rest_alert_notification is not None: + rest_definition["alertNotificationSetting"] = rest_alert_notification + return rest_definition @classmethod def _from_rest_object( @@ -123,12 +126,22 @@ def _from_rest_object( **kwargs: Any, ) -> "MonitorDefinition": from_rest_alert_notification: Any = None - # TypeSpec model uses alert_notification_settings (plural), old autorest uses alert_notification_setting - _alert_setting = getattr(obj, "alert_notification_settings", None) or getattr( - obj, "alert_notification_setting", None - ) + # The 2023-06-01-preview wire uses the singular ``alertNotificationSetting``; read it via mapping access + # (arm-hybrid backing store) with attribute fallbacks for older shapes. + _alert_setting = None + if hasattr(obj, "__contains__") and "alertNotificationSetting" in obj: + _alert_setting = obj["alertNotificationSetting"] + else: + _alert_setting = getattr(obj, "alert_notification_settings", None) or getattr( + obj, "alert_notification_setting", None + ) if _alert_setting: - if isinstance(_alert_setting, AzMonMonitoringAlertNotificationSettings): + _alert_type = ( + _alert_setting.get("alertNotificationType") + if hasattr(_alert_setting, "get") + else getattr(_alert_setting, "alert_notification_type", None) + ) + if _alert_type == "AzureMonitor": from_rest_alert_notification = AZMONITORING else: from_rest_alert_notification = AlertNotification._from_rest_object(_alert_setting) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/input_data.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/input_data.py index 10d80531fcdc..0bd7c60d37e2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/input_data.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/input_data.py @@ -7,12 +7,10 @@ import datetime from typing import Dict, Optional -import isodate - -from azure.ai.ml._restclient.v2023_06_01_preview.models import FixedInputData as RestFixedInputData -from azure.ai.ml._restclient.v2023_06_01_preview.models import MonitoringInputDataBase as RestMonitorInputBase -from azure.ai.ml._restclient.v2023_06_01_preview.models import StaticInputData as RestStaticInputData -from azure.ai.ml._restclient.v2023_06_01_preview.models import TrailingInputData as RestTrailingInputData +from azure.ai.ml._restclient.arm_ml_service.models import FixedInputData as RestFixedInputData +from azure.ai.ml._restclient.arm_ml_service.models import MonitoringInputDataBase as RestMonitorInputBase +from azure.ai.ml._restclient.arm_ml_service.models import RollingInputData as RestRollingInputData +from azure.ai.ml._restclient.arm_ml_service.models import StaticInputData as RestStaticInputData from azure.ai.ml._utils.utils import camel_to_snake, snake_to_camel from azure.ai.ml.constants._monitoring import MonitorDatasetContext, MonitorInputDataType from azure.ai.ml.entities._mixins import RestTranslatableMixin @@ -130,8 +128,11 @@ def __init__( self.window_offset = window_offset self.pre_processing_component_id = pre_processing_component_id - def _to_rest_object(self) -> RestTrailingInputData: - return RestTrailingInputData( + def _to_rest_object(self) -> RestRollingInputData: + # ``TrailingInputData`` was renamed to ``RollingInputData`` (inputDataType "Rolling") in the + # shared arm_ml_service model. The migration pins api-version 2023-06-01-preview, whose service + # contract still expects inputDataType "Trailing", so override the wire discriminator to preserve it. + rest_object = RestRollingInputData( data_context=camel_to_snake(self.data_context), columns=self.target_columns, job_input_type=self.job_type, @@ -140,17 +141,22 @@ def _to_rest_object(self) -> RestTrailingInputData: window_offset=self.window_offset, preprocessing_component_id=self.pre_processing_component_id, ) + rest_object["inputDataType"] = "Trailing" + return rest_object @classmethod - def _from_rest_object(cls, obj: RestTrailingInputData) -> "TrailingInputData": + def _from_rest_object(cls, obj: RestRollingInputData) -> "TrailingInputData": + # ``inputDataType: "Trailing"`` is not a known arm discriminator (arm uses "Rolling"), so the + # object deserializes to the base ``MonitoringInputDataBase``; read the rolling fields, which are + # already ISO-8601 strings on the wire, via their camelCase mapping keys. return cls( - data_context=snake_to_camel(obj.data_context), - target_columns=obj.columns, - job_type=obj.job_input_type, - uri=obj.uri, - window_size=str(isodate.duration_isoformat(obj.window_size)), - window_offset=str(isodate.duration_isoformat(obj.window_offset)), - pre_processing_component_id=obj.preprocessing_component_id, + data_context=snake_to_camel(obj["dataContext"]), + target_columns=obj.get("columns"), + job_type=obj["jobInputType"], + uri=obj["uri"], + window_size=obj["windowSize"], + window_offset=obj["windowOffset"], + pre_processing_component_id=obj.get("preprocessingComponentId"), ) @@ -183,15 +189,23 @@ def __init__( self.window_end = window_end def _to_rest_object(self) -> RestStaticInputData: - return RestStaticInputData( + window_start = datetime.datetime.strptime(str(self.window_start), "%Y-%m-%d") + window_end = datetime.datetime.strptime(str(self.window_end), "%Y-%m-%d") + rest_object = RestStaticInputData( data_context=camel_to_snake(self.data_context), columns=self.target_columns, job_input_type=self.job_type, uri=self.uri, preprocessing_component_id=self.pre_processing_component_id, - window_start=datetime.datetime.strptime(str(self.window_start), "%Y-%m-%d"), - window_end=datetime.datetime.strptime(str(self.window_end), "%Y-%m-%d"), + window_start=window_start, + window_end=window_end, ) + # The arm_ml_service encoder drops sub-second precision (``...00:00:00Z``); the 2023-06-01-preview + # msrest client emitted millisecond precision (``...00:00:00.000Z``). Override the wire keys to + # preserve the exact byte form. + rest_object["windowStart"] = window_start.strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z" + rest_object["windowEnd"] = window_end.strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z" + return rest_object @classmethod def _from_rest_object(cls, obj: RestStaticInputData) -> "StaticInputData": diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/schedule.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/schedule.py index f23c4e3eba03..0991a30886ef 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/schedule.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/schedule.py @@ -9,9 +9,9 @@ from pathlib import Path from typing import IO, Any, AnyStr, Dict, Optional, Union, cast -from azure.ai.ml._restclient.v2023_06_01_preview.models import CreateMonitorAction, RecurrenceFrequency -from azure.ai.ml._restclient.v2023_06_01_preview.models import Schedule as RestSchedule -from azure.ai.ml._restclient.v2023_06_01_preview.models import ScheduleProperties +from azure.ai.ml._restclient.arm_ml_service.models import CreateMonitorAction, RecurrenceFrequency +from azure.ai.ml._restclient.arm_ml_service.models import Schedule as RestSchedule +from azure.ai.ml._restclient.arm_ml_service.models import ScheduleProperties from azure.ai.ml._schema.monitoring.schedule import MonitorScheduleSchema from azure.ai.ml._utils.utils import dump_yaml_to_file from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY, ScheduleType diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/signals.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/signals.py index 5a9e1df7c004..763faabb6430 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/signals.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/signals.py @@ -7,44 +7,30 @@ import datetime from typing import Any, Dict, List, Optional, Union -import isodate from typing_extensions import Literal from azure.ai.ml._exception_helper import log_and_raise_error -from azure.ai.ml._restclient.v2023_06_01_preview.models import AllFeatures as RestAllFeatures -from azure.ai.ml._restclient.v2023_06_01_preview.models import CustomMonitoringSignal as RestCustomMonitoringSignal -from azure.ai.ml._restclient.v2023_06_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import AllFeatures as RestAllFeatures +from azure.ai.ml._restclient.arm_ml_service.models import CustomMonitoringSignal as RestCustomMonitoringSignal +from azure.ai.ml._restclient.arm_ml_service.models import ( DataDriftMonitoringSignal as RestMonitoringDataDriftSignal, ) -from azure.ai.ml._restclient.v2023_06_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( DataQualityMonitoringSignal as RestMonitoringDataQualitySignal, ) -from azure.ai.ml._restclient.v2023_06_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( FeatureAttributionDriftMonitoringSignal as RestFeatureAttributionDriftMonitoringSignal, ) -from azure.ai.ml._restclient.v2023_06_01_preview.models import FeatureSubset as RestFeatureSubset -from azure.ai.ml._restclient.v2023_06_01_preview.models import ( - GenerationSafetyQualityMonitoringSignal as RestGenerationSafetyQualityMonitoringSignal, -) -from azure.ai.ml._restclient.v2023_06_01_preview.models import ( - GenerationTokenStatisticsSignal as RestGenerationTokenStatisticsSignal, -) -from azure.ai.ml._restclient.v2023_06_01_preview.models import ModelPerformanceSignal as RestModelPerformanceSignal -from azure.ai.ml._restclient.v2023_06_01_preview.models import MonitoringDataSegment as RestMonitoringDataSegment -from azure.ai.ml._restclient.v2023_06_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import FeatureSubset as RestFeatureSubset +from azure.ai.ml._restclient.arm_ml_service.models import ( MonitoringFeatureFilterBase as RestMonitoringFeatureFilterBase, ) -from azure.ai.ml._restclient.v2023_06_01_preview.models import MonitoringInputDataBase as RestMonitoringInputData -from azure.ai.ml._restclient.v2023_06_01_preview.models import MonitoringNotificationMode -from azure.ai.ml._restclient.v2023_06_01_preview.models import MonitoringSignalBase as RestMonitoringSignalBase -from azure.ai.ml._restclient.v2023_06_01_preview.models import MonitoringSignalType -from azure.ai.ml._restclient.v2023_06_01_preview.models import ( - MonitoringWorkspaceConnection as RestMonitoringWorkspaceConnection, -) -from azure.ai.ml._restclient.v2023_06_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import MonitoringInputDataBase as RestMonitoringInputData +from azure.ai.ml._restclient.arm_ml_service.models import MonitoringSignalBase as RestMonitoringSignalBase +from azure.ai.ml._restclient.arm_ml_service.models import ( PredictionDriftMonitoringSignal as RestPredictionDriftMonitoringSignal, ) -from azure.ai.ml._restclient.v2023_06_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( TopNFeaturesByAttribution as RestTopNFeaturesByAttribution, ) from azure.ai.ml._utils._experimental import experimental @@ -93,14 +79,17 @@ def __init__( self.feature_name = feature_name self.feature_values = feature_values - def _to_rest_object(self) -> RestMonitoringDataSegment: - return RestMonitoringDataSegment(feature=self.feature_name, values=self.feature_values) + def _to_rest_object(self) -> dict: + # ``MonitoringDataSegment`` is not in arm_ml_service; emit the wire dict directly. + rest_obj = {"feature": self.feature_name, "values": self.feature_values} + return {k: v for k, v in rest_obj.items() if v is not None} @classmethod - def _from_rest_object(cls, obj: RestMonitoringDataSegment) -> "DataSegment": + def _from_rest_object(cls, obj) -> "DataSegment": + # arm hybrid models and plain dicts both support mapping access. return cls( - feature_name=obj.feature, - feature_values=obj.values, + feature_name=obj["feature"], + feature_values=obj["values"], ) @@ -208,19 +197,21 @@ def _to_rest_object(self, **kwargs: Any) -> RestMonitoringInputData: @classmethod def _from_rest_object(cls, obj: RestMonitoringInputData) -> "ProductionData": + # ``inputDataType: "Trailing"`` deserializes to the base type; rolling fields are ISO strings + # read via camelCase mapping keys. data_window = BaselineDataRange( - lookback_window_size=isodate.duration_isoformat(obj.window_size), - lookback_window_offset=isodate.duration_isoformat(obj.window_offset), + lookback_window_size=obj["windowSize"], + lookback_window_offset=obj["windowOffset"], ) return cls( input_data=Input( - path=obj.uri, - type=obj.job_input_type, + path=obj["uri"], + type=obj["jobInputType"], ), - data_context=obj.data_context, - pre_processing_component=obj.preprocessing_component_id, + data_context=obj["dataContext"], + pre_processing_component=obj.get("preprocessingComponentId"), data_window=data_window, - data_column_names=obj.columns, + data_column_names=obj.get("columns"), ) def _validate(self) -> None: @@ -311,27 +302,31 @@ def _to_rest_object(self, **kwargs: Any) -> RestMonitoringInputData: @classmethod def _from_rest_object(cls, obj: RestMonitoringInputData) -> "ReferenceData": + # ``inputDataType: "Trailing"`` deserializes to the base ``MonitoringInputDataBase`` (arm uses + # "Rolling"); read its rolling fields via camelCase mapping keys. Static/Fixed are valid arm + # discriminators and keep typed attribute access. + input_data_type = obj["inputDataType"] data_window = None - if obj.input_data_type == "Static": + if input_data_type == "Static": data_window = BaselineDataRange( window_start=datetime.datetime.strftime(obj.window_start, "%Y-%m-%d"), window_end=datetime.datetime.strftime(obj.window_end, "%Y-%m-%d"), ) - if obj.input_data_type == "Trailing": + if input_data_type == "Trailing": data_window = BaselineDataRange( - lookback_window_size=isodate.duration_isoformat(obj.window_size), - lookback_window_offset=isodate.duration_isoformat(obj.window_offset), + lookback_window_size=obj["windowSize"], + lookback_window_offset=obj["windowOffset"], ) return cls( input_data=Input( - path=obj.uri, - type=obj.job_input_type, + path=obj["uri"], + type=obj["jobInputType"], ), - data_context=obj.data_context, - pre_processing_component=obj.preprocessing_component_id if obj.input_data_type != "Fixed" else None, + data_context=obj["dataContext"], + pre_processing_component=(obj.get("preprocessingComponentId") if input_data_type != "Fixed" else None), data_window=data_window, - data_column_names=obj.columns, + data_column_names=obj.get("columns"), ) @@ -392,23 +387,25 @@ def _from_rest_object(cls, obj: RestMonitoringSignalBase) -> Optional[ # pylint "GenerationTokenStatisticsSignal", ] ]: - if obj.signal_type == MonitoringSignalType.DATA_DRIFT: + # Read the discriminator via its wire key: signals removed from arm_ml_service (ModelPerformance, + # GenerationSafetyQuality, GenerationTokenStatistics) deserialize to the base type, so attribute + # access and the arm ``MonitoringSignalType`` enum (which lacks those members) are not available. + signal_type = obj.get("signalType") + if signal_type == "DataDrift": return DataDriftSignal._from_rest_object(obj) - if obj.signal_type == MonitoringSignalType.DATA_QUALITY: + if signal_type == "DataQuality": return DataQualitySignal._from_rest_object(obj) - if obj.signal_type == MonitoringSignalType.PREDICTION_DRIFT: + if signal_type == "PredictionDrift": return PredictionDriftSignal._from_rest_object(obj) - if obj.signal_type == "ModelPerformanceSignalBase": + if signal_type == "ModelPerformance": return ModelPerformanceSignal._from_rest_object(obj) - if obj.signal_type == MonitoringSignalType.FEATURE_ATTRIBUTION_DRIFT: + if signal_type == "FeatureAttributionDrift": return FeatureAttributionDriftSignal._from_rest_object(obj) - if obj.signal_type == MonitoringSignalType.CUSTOM: + if signal_type == "Custom": return CustomMonitoringSignal._from_rest_object(obj) - if obj.signal_type == MonitoringSignalType.GENERATION_SAFETY_QUALITY: + if signal_type == "GenerationSafetyQuality": return GenerationSafetyQualitySignal._from_rest_object(obj) - if obj.signal_type == MonitoringSignalType.MODEL_PERFORMANCE: - return ModelPerformanceSignal._from_rest_object(obj) - if obj.signal_type == MonitoringSignalType.GENERATION_TOKEN_STATISTICS: + if signal_type == "GenerationTokenStatistics": return GenerationTokenStatisticsSignal._from_rest_object(obj) return None @@ -512,7 +509,7 @@ def _to_rest_object(self, **kwargs: Any) -> RestMonitoringDataDriftSignal: if self.production_data is not None and self.production_data.data_window is None: self.production_data.data_window = BaselineDataRange(lookback_window_size=default_data_window_size) rest_features = _to_rest_features(self.features) if self.features else None - return RestMonitoringDataDriftSignal( + rest_signal = RestMonitoringDataDriftSignal( production_data=( self.production_data._to_rest_object(default_data_window_size=default_data_window_size) if self.production_data is not None @@ -532,26 +529,27 @@ def _to_rest_object(self, **kwargs: Any) -> RestMonitoringDataDriftSignal: if isinstance(self.metric_thresholds, MetricThreshold) else None ), - mode=MonitoringNotificationMode.ENABLED if self.alert_enabled else MonitoringNotificationMode.DISABLED, - data_segment=self.data_segment._to_rest_object() if self.data_segment else None, - properties=self.properties, ) + # ``mode``, ``dataSegment`` and ``properties`` are not typed on the arm model; set wire keys. + rest_signal["mode"] = "Enabled" if self.alert_enabled else "Disabled" + if self.data_segment: + rest_signal["dataSegment"] = self.data_segment._to_rest_object() + if self.properties is not None: + rest_signal["properties"] = self.properties + return rest_signal @classmethod def _from_rest_object(cls, obj: RestMonitoringDataDriftSignal) -> "DataDriftSignal": + data_segment = obj.get("dataSegment") return cls( production_data=ProductionData._from_rest_object(obj.production_data), reference_data=ReferenceData._from_rest_object(obj.reference_data), features=_from_rest_features(obj.features), feature_type_override=obj.feature_data_type_override, metric_thresholds=DataDriftMetricThreshold._from_rest_object(obj.metric_thresholds), - alert_enabled=( - False - if not obj.mode or (obj.mode and obj.mode == MonitoringNotificationMode.DISABLED) - else MonitoringNotificationMode.ENABLED - ), - data_segment=DataSegment._from_rest_object(obj.data_segment) if obj.data_segment else None, - properties=obj.properties, + alert_enabled=bool(obj.get("mode") == "Enabled"), + data_segment=DataSegment._from_rest_object(data_segment) if data_segment else None, + properties=obj.get("properties"), ) @classmethod @@ -602,7 +600,7 @@ def _to_rest_object(self, **kwargs: Any) -> RestPredictionDriftMonitoringSignal: ref_data_window_size = kwargs.get("ref_data_window_size") if self.production_data is not None and self.production_data.data_window is None: self.production_data.data_window = BaselineDataRange(lookback_window_size=default_data_window_size) - return RestPredictionDriftMonitoringSignal( + rest_signal = RestPredictionDriftMonitoringSignal( production_data=( self.production_data._to_rest_object(default_data_window_size=default_data_window_size) if self.production_data is not None @@ -620,10 +618,13 @@ def _to_rest_object(self, **kwargs: Any) -> RestPredictionDriftMonitoringSignal: if isinstance(self.metric_thresholds, MetricThreshold) else None ), - properties=self.properties, - mode=MonitoringNotificationMode.ENABLED if self.alert_enabled else MonitoringNotificationMode.DISABLED, - model_type="classification", ) + # ``properties``, ``mode`` and ``modelType`` are not typed on the arm model; set wire keys. + if self.properties is not None: + rest_signal["properties"] = self.properties + rest_signal["mode"] = "Enabled" if self.alert_enabled else "Disabled" + rest_signal["modelType"] = "classification" + return rest_signal @classmethod def _from_rest_object(cls, obj: RestPredictionDriftMonitoringSignal) -> "PredictionDriftSignal": @@ -631,12 +632,8 @@ def _from_rest_object(cls, obj: RestPredictionDriftMonitoringSignal) -> "Predict production_data=ProductionData._from_rest_object(obj.production_data), reference_data=ReferenceData._from_rest_object(obj.reference_data), metric_thresholds=PredictionDriftMetricThreshold._from_rest_object(obj.metric_thresholds), - alert_enabled=( - False - if not obj.mode or (obj.mode and obj.mode == MonitoringNotificationMode.DISABLED) - else MonitoringNotificationMode.ENABLED - ), - properties=obj.properties, + alert_enabled=bool(obj.get("mode") == "Enabled"), + properties=obj.get("properties"), ) @classmethod @@ -705,7 +702,7 @@ def _to_rest_object(self, **kwargs: Any) -> RestMonitoringDataQualitySignal: if isinstance(self.metric_thresholds, MetricThreshold) else None ) - return RestMonitoringDataQualitySignal( + rest_signal = RestMonitoringDataQualitySignal( production_data=( self.production_data._to_rest_object(default_data_window_size=default_data_window_size) if self.production_data is not None @@ -721,9 +718,12 @@ def _to_rest_object(self, **kwargs: Any) -> RestMonitoringDataQualitySignal: features=rest_features, feature_data_type_override=self.feature_type_override, metric_thresholds=rest_metrics, - mode=MonitoringNotificationMode.ENABLED if self.alert_enabled else MonitoringNotificationMode.DISABLED, - properties=self.properties, ) + # ``mode`` and ``properties`` are not typed on the arm model; set wire keys. + rest_signal["mode"] = "Enabled" if self.alert_enabled else "Disabled" + if self.properties is not None: + rest_signal["properties"] = self.properties + return rest_signal @classmethod def _from_rest_object(cls, obj: RestMonitoringDataQualitySignal) -> "DataQualitySignal": @@ -733,12 +733,8 @@ def _from_rest_object(cls, obj: RestMonitoringDataQualitySignal) -> "DataQuality features=_from_rest_features(obj.features), feature_type_override=obj.feature_data_type_override, metric_thresholds=DataQualityMetricThreshold._from_rest_object(obj.metric_thresholds), - alert_enabled=( - False - if not obj.mode or (obj.mode and obj.mode == MonitoringNotificationMode.DISABLED) - else MonitoringNotificationMode.ENABLED - ), - properties=obj.properties, + alert_enabled=bool(obj.get("mode") == "Enabled"), + properties=obj.get("properties"), ) @classmethod @@ -811,18 +807,19 @@ def _to_rest_object(self, **kwargs: Any) -> RestMonitoringInputData: @classmethod def _from_rest_object(cls, obj: RestMonitoringInputData) -> "FADProductionData": + # ``inputDataType: "Trailing"`` deserializes to the base type; read rolling fields via mapping keys. data_window = BaselineDataRange( - lookback_window_size=isodate.duration_isoformat(obj.window_size), - lookback_window_offset=isodate.duration_isoformat(obj.window_offset), + lookback_window_size=obj["windowSize"], + lookback_window_offset=obj["windowOffset"], ) return cls( input_data=Input( - path=obj.uri, - type=obj.job_input_type, + path=obj["uri"], + type=obj["jobInputType"], ), - data_context=obj.data_context, - data_column_names=obj.columns, - pre_processing_component=obj.preprocessing_component_id, + data_context=obj["dataContext"], + data_column_names=obj.get("columns"), + pre_processing_component=obj.get("preprocessingComponentId"), data_window=data_window, ) @@ -863,7 +860,7 @@ def __init__( def _to_rest_object(self, **kwargs: Any) -> RestFeatureAttributionDriftMonitoringSignal: default_window_size = kwargs.get("default_data_window_size") ref_data_window_size = kwargs.get("ref_data_window_size") - return RestFeatureAttributionDriftMonitoringSignal( + rest_signal = RestFeatureAttributionDriftMonitoringSignal( production_data=( [data._to_rest_object(default=default_window_size) for data in self.production_data] if self.production_data is not None @@ -873,9 +870,12 @@ def _to_rest_object(self, **kwargs: Any) -> RestFeatureAttributionDriftMonitorin default_data_window=default_window_size, ref_data_window_size=ref_data_window_size ), metric_threshold=self.metric_thresholds._to_rest_object(), - mode=MonitoringNotificationMode.ENABLED if self.alert_enabled else MonitoringNotificationMode.DISABLED, - properties=self.properties, ) + # ``mode`` and ``properties`` are not typed on the arm model; set wire keys. + rest_signal["mode"] = "Enabled" if self.alert_enabled else "Disabled" + if self.properties is not None: + rest_signal["properties"] = self.properties + return rest_signal @classmethod def _from_rest_object(cls, obj: RestFeatureAttributionDriftMonitoringSignal) -> "FeatureAttributionDriftSignal": @@ -883,12 +883,8 @@ def _from_rest_object(cls, obj: RestFeatureAttributionDriftMonitoringSignal) -> production_data=[FADProductionData._from_rest_object(data) for data in obj.production_data], reference_data=ReferenceData._from_rest_object(obj.reference_data), metric_thresholds=FeatureAttributionDriftMetricThreshold._from_rest_object(obj.metric_threshold), - alert_enabled=( - False - if not obj.mode or (obj.mode and obj.mode == MonitoringNotificationMode.DISABLED) - else MonitoringNotificationMode.ENABLED - ), - properties=obj.properties, + alert_enabled=bool(obj.get("mode") == "Enabled"), + properties=obj.get("properties"), ) @@ -927,7 +923,7 @@ def __init__( self.data_segment = data_segment self.properties = properties - def _to_rest_object(self, **kwargs: Any) -> RestModelPerformanceSignal: + def _to_rest_object(self, **kwargs: Any) -> dict: default_data_window_size = kwargs.get("default_data_window_size") ref_data_window_size = kwargs.get("ref_data_window_size") if self.properties is None: @@ -937,29 +933,29 @@ def _to_rest_object(self, **kwargs: Any) -> RestModelPerformanceSignal: self.production_data.data_window = BaselineDataRange( lookback_window_size=default_data_window_size, ) - return RestModelPerformanceSignal( - production_data=[self.production_data._to_rest_object(default_data_window_size=default_data_window_size)], - reference_data=self.reference_data._to_rest_object( + # ``ModelPerformanceSignal`` is not in arm_ml_service; emit the wire dict directly. + rest_obj = { + "signalType": "ModelPerformance", + "productionData": [self.production_data._to_rest_object(default_data_window_size=default_data_window_size)], + "referenceData": self.reference_data._to_rest_object( default_data_window_size=default_data_window_size, ref_data_window_size=ref_data_window_size ), - metric_threshold=self.metric_thresholds._to_rest_object(), - data_segment=self.data_segment._to_rest_object() if self.data_segment else None, - mode=MonitoringNotificationMode.ENABLED if self.alert_enabled else MonitoringNotificationMode.DISABLED, - properties=self.properties, - ) + "metricThreshold": self.metric_thresholds._to_rest_object(), + "dataSegment": self.data_segment._to_rest_object() if self.data_segment else None, + "mode": "Enabled" if self.alert_enabled else "Disabled", + "properties": self.properties, + } + return {k: v for k, v in rest_obj.items() if v is not None} @classmethod - def _from_rest_object(cls, obj: RestModelPerformanceSignal) -> "ModelPerformanceSignal": + def _from_rest_object(cls, obj) -> "ModelPerformanceSignal": + data_segment = obj.get("dataSegment") return cls( - production_data=ProductionData._from_rest_object(obj.production_data[0]), - reference_data=ReferenceData._from_rest_object(obj.reference_data), - metric_thresholds=ModelPerformanceMetricThreshold._from_rest_object(obj.metric_threshold), - data_segment=DataSegment._from_rest_object(obj.data_segment) if obj.data_segment else None, - alert_enabled=( - False - if not obj.mode or (obj.mode and obj.mode == MonitoringNotificationMode.DISABLED) - else MonitoringNotificationMode.ENABLED - ), + production_data=ProductionData._from_rest_object(obj["productionData"][0]), + reference_data=ReferenceData._from_rest_object(obj["referenceData"]), + metric_thresholds=ModelPerformanceMetricThreshold._from_rest_object(obj["metricThreshold"]), + data_segment=DataSegment._from_rest_object(data_segment) if data_segment else None, + alert_enabled=bool(obj.get("mode") == "Enabled"), ) @@ -982,17 +978,20 @@ def __init__( self.environment_variables = environment_variables self.secret_config = secret_config - def _to_rest_object(self) -> RestMonitoringWorkspaceConnection: - return RestMonitoringWorkspaceConnection( - environment_variables=self.environment_variables, - secrets=self.secret_config, - ) + def _to_rest_object(self) -> dict: + # ``MonitoringWorkspaceConnection`` is not in arm_ml_service; emit the wire dict directly. + rest_obj = { + "environmentVariables": self.environment_variables, + "secrets": self.secret_config, + } + return {k: v for k, v in rest_obj.items() if v is not None} @classmethod - def _from_rest_object(cls, obj: RestMonitoringWorkspaceConnection) -> "Connection": + def _from_rest_object(cls, obj) -> "Connection": + # arm hybrid models and plain dicts both support mapping access. return cls( - environment_variables=obj.environment_variables, - secret_config=obj.secrets, + environment_variables=obj.get("environmentVariables"), + secret_config=obj.get("secrets"), ) @@ -1044,22 +1043,31 @@ def __init__( def _to_rest_object(self, **kwargs: Any) -> RestCustomMonitoringSignal: # pylint:disable=unused-argument if self.connection is None: self.connection = Connection() - return RestCustomMonitoringSignal( + # ``inputs`` come from the shared v2023_04 msrest dataset-literal helper; serialize them to plain + # wire dicts so they fit inside the arm_ml_service signal envelope without changing the wire body. + rest_inputs = to_rest_dataset_literal_inputs(self.inputs, job_type=None) if self.inputs else None + if rest_inputs is not None: + rest_inputs = {name: value.serialize() for name, value in rest_inputs.items()} + rest_signal = RestCustomMonitoringSignal( component_id=self.component_id, metric_thresholds=[threshold._to_rest_object() for threshold in self.metric_thresholds], - inputs=to_rest_dataset_literal_inputs(self.inputs, job_type=None) if self.inputs else None, + inputs=rest_inputs, input_assets=( {asset_name: asset_value._to_rest_object() for asset_name, asset_value in self.input_data.items()} if self.input_data else None ), - workspace_connection=self.connection._to_rest_object(), - mode=MonitoringNotificationMode.ENABLED if self.alert_enabled else MonitoringNotificationMode.DISABLED, - properties=self.properties, ) + # ``workspaceConnection``, ``mode`` and ``properties`` are not typed on the arm model. + rest_signal["workspaceConnection"] = self.connection._to_rest_object() + rest_signal["mode"] = "Enabled" if self.alert_enabled else "Disabled" + if self.properties is not None: + rest_signal["properties"] = self.properties + return rest_signal @classmethod def _from_rest_object(cls, obj: RestCustomMonitoringSignal) -> "CustomMonitoringSignal": + workspace_connection = obj.get("workspaceConnection") return cls( inputs=from_rest_inputs_to_dataset_literal(obj.inputs) if obj.inputs else None, input_data={key: ReferenceData._from_rest_object(data) for key, data in obj.input_assets.items()}, @@ -1067,13 +1075,9 @@ def _from_rest_object(cls, obj: RestCustomMonitoringSignal) -> "CustomMonitoring CustomMonitoringMetricThreshold._from_rest_object(metric) for metric in obj.metric_thresholds ], component_id=obj.component_id, - alert_enabled=( - False - if not obj.mode or (obj.mode and obj.mode == MonitoringNotificationMode.DISABLED) - else MonitoringNotificationMode.ENABLED - ), - properties=obj.properties, - connection=Connection._from_rest_object(obj.workspace_connection), + alert_enabled=bool(obj.get("mode") == "Enabled"), + properties=obj.get("properties"), + connection=Connection._from_rest_object(workspace_connection) if workspace_connection else None, ) @@ -1119,16 +1123,17 @@ def _to_rest_object(self, **kwargs: Any) -> RestMonitoringInputData: @classmethod def _from_rest_object(cls, obj: RestMonitoringInputData) -> "LlmData": + # ``inputDataType: "Trailing"`` deserializes to the base type; read rolling fields via mapping keys. data_window = BaselineDataRange( - lookback_window_size=isodate.duration_isoformat(obj.window_size), - lookback_window_offset=isodate.duration_isoformat(obj.window_offset), + lookback_window_size=obj["windowSize"], + lookback_window_offset=obj["windowOffset"], ) return cls( input_data=Input( - path=obj.uri, - type=obj.job_input_type, + path=obj["uri"], + type=obj["jobInputType"], ), - data_column_names=obj.columns, + data_column_names=obj.get("columns"), data_window=data_window, ) @@ -1173,34 +1178,35 @@ def __init__( self.properties = properties self.sampling_rate = sampling_rate - def _to_rest_object(self, **kwargs: Any) -> RestGenerationSafetyQualityMonitoringSignal: + def _to_rest_object(self, **kwargs: Any) -> dict: data_window_size = kwargs.get("default_data_window_size") - return RestGenerationSafetyQualityMonitoringSignal( - production_data=( + # ``GenerationSafetyQualityMonitoringSignal`` is not in arm_ml_service; emit the wire dict directly. + rest_obj = { + "signalType": "GenerationSafetyQuality", + "productionData": ( [data._to_rest_object(default=data_window_size) for data in self.production_data] if self.production_data is not None else None ), - workspace_connection_id=self.connection_id, - metric_thresholds=self.metric_thresholds._to_rest_object(), - mode=MonitoringNotificationMode.ENABLED if self.alert_enabled else MonitoringNotificationMode.DISABLED, - properties=self.properties, - sampling_rate=self.sampling_rate, - ) + "workspaceConnectionId": self.connection_id, + "metricThresholds": self.metric_thresholds._to_rest_object(), + "mode": "Enabled" if self.alert_enabled else "Disabled", + "properties": self.properties, + "samplingRate": self.sampling_rate, + } + return {k: v for k, v in rest_obj.items() if v is not None} @classmethod - def _from_rest_object(cls, obj: RestGenerationSafetyQualityMonitoringSignal) -> "GenerationSafetyQualitySignal": + def _from_rest_object(cls, obj) -> "GenerationSafetyQualitySignal": return cls( - production_data=[LlmData._from_rest_object(data) for data in obj.production_data], - connection_id=obj.workspace_connection_id, - metric_thresholds=GenerationSafetyQualityMonitoringMetricThreshold._from_rest_object(obj.metric_thresholds), - alert_enabled=( - False - if not obj.mode or (obj.mode and obj.mode == MonitoringNotificationMode.DISABLED) - else MonitoringNotificationMode.ENABLED + production_data=[LlmData._from_rest_object(data) for data in obj["productionData"]], + connection_id=obj.get("workspaceConnectionId"), + metric_thresholds=GenerationSafetyQualityMonitoringMetricThreshold._from_rest_object( + obj["metricThresholds"] ), - properties=obj.properties, - sampling_rate=obj.sampling_rate, + alert_enabled=bool(obj.get("mode") == "Enabled"), + properties=obj.get("properties"), + sampling_rate=obj.get("samplingRate"), ) @@ -1248,36 +1254,37 @@ def __init__( self.properties = properties self.sampling_rate = sampling_rate - def _to_rest_object(self, **kwargs: Any) -> RestGenerationTokenStatisticsSignal: + def _to_rest_object(self, **kwargs: Any) -> dict: data_window_size = kwargs.get("default_data_window_size") - return RestGenerationTokenStatisticsSignal( - production_data=( + # ``GenerationTokenStatisticsSignal`` is not in arm_ml_service; emit the wire dict directly. + rest_obj = { + "signalType": "GenerationTokenStatistics", + "productionData": ( self.production_data._to_rest_object(default=data_window_size) if self.production_data is not None else None ), - metric_thresholds=( + "metricThresholds": ( self.metric_thresholds._to_rest_object() if self.metric_thresholds else GenerationTokenStatisticsMonitorMetricThreshold._get_default_thresholds()._to_rest_object() ), - mode=MonitoringNotificationMode.ENABLED if self.alert_enabled else MonitoringNotificationMode.DISABLED, - properties=self.properties, - sampling_rate=self.sampling_rate if self.sampling_rate else 0.1, - ) + "mode": "Enabled" if self.alert_enabled else "Disabled", + "properties": self.properties, + "samplingRate": self.sampling_rate if self.sampling_rate else 0.1, + } + return {k: v for k, v in rest_obj.items() if v is not None} @classmethod - def _from_rest_object(cls, obj: RestGenerationTokenStatisticsSignal) -> "GenerationTokenStatisticsSignal": + def _from_rest_object(cls, obj) -> "GenerationTokenStatisticsSignal": return cls( - production_data=LlmData._from_rest_object(obj.production_data), - metric_thresholds=GenerationTokenStatisticsMonitorMetricThreshold._from_rest_object(obj.metric_thresholds), - alert_enabled=( - False - if not obj.mode or (obj.mode and obj.mode == MonitoringNotificationMode.DISABLED) - else MonitoringNotificationMode.ENABLED + production_data=LlmData._from_rest_object(obj["productionData"]), + metric_thresholds=GenerationTokenStatisticsMonitorMetricThreshold._from_rest_object( + obj["metricThresholds"] ), - properties=obj.properties, - sampling_rate=obj.sampling_rate, + alert_enabled=bool(obj.get("mode") == "Enabled"), + properties=obj.get("properties"), + sampling_rate=obj.get("samplingRate"), ) @classmethod diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/target.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/target.py index 73a118953951..a97fde339dde 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/target.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/target.py @@ -4,7 +4,7 @@ from typing import Optional, Union -from azure.ai.ml._restclient.v2023_06_01_preview.models import MonitoringTarget as RestMonitoringTarget +from azure.ai.ml._restclient.arm_ml_service.models import MonitoringTarget as RestMonitoringTarget from azure.ai.ml.constants._monitoring import MonitorTargetTasks diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/thresholds.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/thresholds.py index 3e1c33b53af0..cf2c7f11181d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/thresholds.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/thresholds.py @@ -6,18 +6,14 @@ from typing import Any, Dict, List, Optional, Tuple -from azure.ai.ml._restclient.v2023_06_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ( CategoricalDataDriftMetricThreshold, CategoricalDataQualityMetricThreshold, CategoricalPredictionDriftMetricThreshold, - ClassificationModelPerformanceMetricThreshold, CustomMetricThreshold, DataDriftMetricThresholdBase, DataQualityMetricThresholdBase, FeatureAttributionMetricThreshold, - GenerationSafetyQualityMetricThreshold, - GenerationTokenStatisticsMetricThreshold, - ModelPerformanceMetricThresholdBase, MonitoringThreshold, NumericalDataDriftMetricThreshold, NumericalDataQualityMetricThreshold, @@ -613,8 +609,10 @@ def _to_str_object(self, **kwargs): @classmethod def _from_rest_object(cls, obj) -> "ModelPerformanceClassificationThresholds": + # The wire is a plain dict (the model is not in arm_ml_service); read via keys. + threshold = obj.get("threshold") if hasattr(obj, "get") else None return cls( - accuracy=obj.threshold.value if obj.threshold else None, + accuracy=threshold["value"] if threshold else None, ) @@ -684,15 +682,18 @@ def _to_str_object(self, **kwargs): result = "[" + thresholds[0] + "]" return result - def _to_rest_object(self, **kwargs) -> ModelPerformanceMetricThresholdBase: - threshold = MonitoringThreshold(value=0.9) - return ClassificationModelPerformanceMetricThreshold( - metric="Accuracy", - threshold=threshold, - ) + def _to_rest_object(self, **kwargs) -> Dict: + # ``ClassificationModelPerformanceMetricThreshold`` / ``ModelPerformanceMetricThresholdBase`` do not exist + # in the shared arm_ml_service model. Build the 2023-06-01-preview wire shape directly. The polymorphic + # ``modelType`` discriminator ("Classification") that the old autorest model emitted is set explicitly. + return { + "metric": "Accuracy", + "modelType": "Classification", + "threshold": {"value": 0.9}, + } @classmethod - def _from_rest_object(cls, obj: ModelPerformanceMetricThresholdBase) -> "ModelPerformanceMetricThreshold": + def _from_rest_object(cls, obj: Any) -> "ModelPerformanceMetricThreshold": return cls( classification=ModelPerformanceClassificationThresholds._from_rest_object(obj), regression=None, @@ -761,102 +762,85 @@ def __init__( self.fluency = fluency self.similarity = similarity - def _to_rest_object(self) -> GenerationSafetyQualityMetricThreshold: + def _to_rest_object(self) -> List[Dict]: + # ``GenerationSafetyQualityMetricThreshold`` does not exist in the shared arm_ml_service model. Build the + # 2023-06-01-preview wire shape directly as plain dicts. ``float(...)`` preserves the old autorest behavior + # of serializing the ``MonitoringThreshold.value`` field as a float (e.g. the default ``3`` -> ``3.0``). metric_thresholds = [] if self.groundedness: if "acceptable_groundedness_score_per_instance" in self.groundedness: - acceptable_threshold = MonitoringThreshold( - value=self.groundedness["acceptable_groundedness_score_per_instance"] - ) + acceptable_value = self.groundedness["acceptable_groundedness_score_per_instance"] else: - acceptable_threshold = MonitoringThreshold(value=3) + acceptable_value = 3 metric_thresholds.append( - GenerationSafetyQualityMetricThreshold( - metric="AcceptableGroundednessScorePerInstance", threshold=acceptable_threshold - ) + {"metric": "AcceptableGroundednessScorePerInstance", "threshold": {"value": float(acceptable_value)}} ) - aggregated_threshold = MonitoringThreshold(value=self.groundedness["aggregated_groundedness_pass_rate"]) metric_thresholds.append( - GenerationSafetyQualityMetricThreshold( - metric="AggregatedGroundednessPassRate", threshold=aggregated_threshold - ) + { + "metric": "AggregatedGroundednessPassRate", + "threshold": {"value": float(self.groundedness["aggregated_groundedness_pass_rate"])}, + } ) if self.relevance: if "acceptable_relevance_score_per_instance" in self.relevance: - acceptable_threshold = MonitoringThreshold( - value=self.relevance["acceptable_relevance_score_per_instance"] - ) + acceptable_value = self.relevance["acceptable_relevance_score_per_instance"] else: - acceptable_threshold = MonitoringThreshold(value=3) + acceptable_value = 3 metric_thresholds.append( - GenerationSafetyQualityMetricThreshold( - metric="AcceptableRelevanceScorePerInstance", threshold=acceptable_threshold - ) + {"metric": "AcceptableRelevanceScorePerInstance", "threshold": {"value": float(acceptable_value)}} ) - aggregated_threshold = MonitoringThreshold(value=self.relevance["aggregated_relevance_pass_rate"]) metric_thresholds.append( - GenerationSafetyQualityMetricThreshold( - metric="AggregatedRelevancePassRate", threshold=aggregated_threshold - ) + { + "metric": "AggregatedRelevancePassRate", + "threshold": {"value": float(self.relevance["aggregated_relevance_pass_rate"])}, + } ) if self.coherence: if "acceptable_coherence_score_per_instance" in self.coherence: - acceptable_threshold = MonitoringThreshold( - value=self.coherence["acceptable_coherence_score_per_instance"] - ) + acceptable_value = self.coherence["acceptable_coherence_score_per_instance"] else: - acceptable_threshold = MonitoringThreshold(value=3) + acceptable_value = 3 metric_thresholds.append( - GenerationSafetyQualityMetricThreshold( - metric="AcceptableCoherenceScorePerInstance", threshold=acceptable_threshold - ) + {"metric": "AcceptableCoherenceScorePerInstance", "threshold": {"value": float(acceptable_value)}} ) - aggregated_threshold = MonitoringThreshold(value=self.coherence["aggregated_coherence_pass_rate"]) metric_thresholds.append( - GenerationSafetyQualityMetricThreshold( - metric="AggregatedCoherencePassRate", threshold=aggregated_threshold - ) + { + "metric": "AggregatedCoherencePassRate", + "threshold": {"value": float(self.coherence["aggregated_coherence_pass_rate"])}, + } ) if self.fluency: if "acceptable_fluency_score_per_instance" in self.fluency: - acceptable_threshold = MonitoringThreshold(value=self.fluency["acceptable_fluency_score_per_instance"]) + acceptable_value = self.fluency["acceptable_fluency_score_per_instance"] else: - acceptable_threshold = MonitoringThreshold(value=3) + acceptable_value = 3 metric_thresholds.append( - GenerationSafetyQualityMetricThreshold( - metric="AcceptableFluencyScorePerInstance", threshold=acceptable_threshold - ) + {"metric": "AcceptableFluencyScorePerInstance", "threshold": {"value": float(acceptable_value)}} ) - aggregated_threshold = MonitoringThreshold(value=self.fluency["aggregated_fluency_pass_rate"]) metric_thresholds.append( - GenerationSafetyQualityMetricThreshold( - metric="AggregatedFluencyPassRate", threshold=aggregated_threshold - ) + { + "metric": "AggregatedFluencyPassRate", + "threshold": {"value": float(self.fluency["aggregated_fluency_pass_rate"])}, + } ) if self.similarity: if "acceptable_similarity_score_per_instance" in self.similarity: - acceptable_threshold = MonitoringThreshold( - value=self.similarity["acceptable_similarity_score_per_instance"] - ) + acceptable_value = self.similarity["acceptable_similarity_score_per_instance"] else: - acceptable_threshold = MonitoringThreshold(value=3) + acceptable_value = 3 metric_thresholds.append( - GenerationSafetyQualityMetricThreshold( - metric="AcceptableSimilarityScorePerInstance", threshold=acceptable_threshold - ) + {"metric": "AcceptableSimilarityScorePerInstance", "threshold": {"value": float(acceptable_value)}} ) - aggregated_threshold = MonitoringThreshold(value=self.similarity["aggregated_similarity_pass_rate"]) metric_thresholds.append( - GenerationSafetyQualityMetricThreshold( - metric="AggregatedSimilarityPassRate", threshold=aggregated_threshold - ) + { + "metric": "AggregatedSimilarityPassRate", + "threshold": {"value": float(self.similarity["aggregated_similarity_pass_rate"])}, + } ) return metric_thresholds @classmethod - def _from_rest_object( - cls, obj: GenerationSafetyQualityMetricThreshold - ) -> "GenerationSafetyQualityMonitoringMetricThreshold": + def _from_rest_object(cls, obj: Any) -> "GenerationSafetyQualityMonitoringMetricThreshold": groundedness = {} relevance = {} coherence = {} @@ -864,26 +848,29 @@ def _from_rest_object( similarity = {} for threshold in obj: - if threshold.metric == "AcceptableGroundednessScorePerInstance": - groundedness["acceptable_groundedness_score_per_instance"] = threshold.threshold.value - if threshold.metric == "AcceptableRelevanceScorePerInstance": - relevance["acceptable_relevance_score_per_instance"] = threshold.threshold.value - if threshold.metric == "AcceptableCoherenceScorePerInstance": - coherence["acceptable_coherence_score_per_instance"] = threshold.threshold.value - if threshold.metric == "AcceptableFluencyScorePerInstance": - fluency["acceptable_fluency_score_per_instance"] = threshold.threshold.value - if threshold.metric == "AcceptableSimilarityScorePerInstance": - similarity["acceptable_similarity_score_per_instance"] = threshold.threshold.value - if threshold.metric == "AggregatedGroundednessPassRate": - groundedness["aggregated_groundedness_pass_rate"] = threshold.threshold.value - if threshold.metric == "AggregatedRelevancePassRate": - relevance["aggregated_relevance_pass_rate"] = threshold.threshold.value - if threshold.metric == "AggregatedCoherencePassRate": - coherence["aggregated_coherence_pass_rate"] = threshold.threshold.value - if threshold.metric == "AggregatedFluencyPassRate": - fluency["aggregated_fluency_pass_rate"] = threshold.threshold.value - if threshold.metric == "AggregatedSimilarityPassRate": - similarity["aggregated_similarity_pass_rate"] = threshold.threshold.value + # The wire is a list of plain dicts (the model is not in arm_ml_service); read via keys. + metric = threshold["metric"] + value = threshold["threshold"]["value"] + if metric == "AcceptableGroundednessScorePerInstance": + groundedness["acceptable_groundedness_score_per_instance"] = value + if metric == "AcceptableRelevanceScorePerInstance": + relevance["acceptable_relevance_score_per_instance"] = value + if metric == "AcceptableCoherenceScorePerInstance": + coherence["acceptable_coherence_score_per_instance"] = value + if metric == "AcceptableFluencyScorePerInstance": + fluency["acceptable_fluency_score_per_instance"] = value + if metric == "AcceptableSimilarityScorePerInstance": + similarity["acceptable_similarity_score_per_instance"] = value + if metric == "AggregatedGroundednessPassRate": + groundedness["aggregated_groundedness_pass_rate"] = value + if metric == "AggregatedRelevancePassRate": + relevance["aggregated_relevance_pass_rate"] = value + if metric == "AggregatedCoherencePassRate": + coherence["aggregated_coherence_pass_rate"] = value + if metric == "AggregatedFluencyPassRate": + fluency["aggregated_fluency_pass_rate"] = value + if metric == "AggregatedSimilarityPassRate": + similarity["aggregated_similarity_pass_rate"] = value return cls( groundedness=groundedness if groundedness else None, @@ -916,34 +903,34 @@ def __init__( ): self.totaltoken = totaltoken - def _to_rest_object(self) -> GenerationSafetyQualityMetricThreshold: - metric_thresholds = [] + def _to_rest_object(self) -> List[Dict]: + # ``GenerationTokenStatisticsMetricThreshold`` / ``GenerationSafetyQualityMetricThreshold`` do not exist in + # the shared arm_ml_service model. Build the 2023-06-01-preview wire shape directly. ``float(...)`` keeps the + # old autorest float serialization of ``MonitoringThreshold.value``. + metric_thresholds: List[Dict] = [] if self.totaltoken: if "total_token_count" in self.totaltoken: - acceptable_threshold = MonitoringThreshold(value=self.totaltoken["total_token_count"]) + acceptable_value = self.totaltoken["total_token_count"] else: - acceptable_threshold = MonitoringThreshold(value=3) - metric_thresholds.append( - GenerationTokenStatisticsMetricThreshold(metric="TotalTokenCount", threshold=acceptable_threshold) - ) - acceptable_threshold_per_group = MonitoringThreshold(value=self.totaltoken["total_token_count_per_group"]) + acceptable_value = 3 + metric_thresholds.append({"metric": "TotalTokenCount", "threshold": {"value": float(acceptable_value)}}) metric_thresholds.append( - GenerationSafetyQualityMetricThreshold( - metric="TotalTokenCountPerGroup", threshold=acceptable_threshold_per_group - ) + { + "metric": "TotalTokenCountPerGroup", + "threshold": {"value": float(self.totaltoken["total_token_count_per_group"])}, + } ) return metric_thresholds @classmethod - def _from_rest_object( - cls, obj: GenerationTokenStatisticsMetricThreshold - ) -> "GenerationTokenStatisticsMonitorMetricThreshold": + def _from_rest_object(cls, obj: Any) -> "GenerationTokenStatisticsMonitorMetricThreshold": + # The wire is a list of plain dicts (the model is not in arm_ml_service); read via keys. totaltoken = {} for threshold in obj: - if threshold.metric == "TotalTokenCount": - totaltoken["total_token_count"] = threshold.threshold.value - if threshold.metric == "TotalTokenCountPerGroup": - totaltoken["total_token_count_per_group"] = threshold.threshold.value + if threshold["metric"] == "TotalTokenCount": + totaltoken["total_token_count"] = threshold["threshold"]["value"] + if threshold["metric"] == "TotalTokenCountPerGroup": + totaltoken["total_token_count_per_group"] = threshold["threshold"]["value"] return cls( totaltoken=totaltoken if totaltoken else None, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_notification/notification.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_notification/notification.py index 913808701dce..dac66c98e0d0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_notification/notification.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_notification/notification.py @@ -4,7 +4,7 @@ from typing import List, Optional -from azure.ai.ml._restclient.v2023_02_01_preview.models import NotificationSetting as RestNotificationSetting +from azure.ai.ml._restclient.arm_ml_service.models import NotificationSetting as RestNotificationSetting from azure.ai.ml.entities._mixins import RestTranslatableMixin diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py index a01e70d3816c..746b55fdac2d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py @@ -8,12 +8,12 @@ from pathlib import Path from typing import IO, Any, AnyStr, Dict, List, Optional, Union -from azure.ai.ml._restclient.v2022_10_01_preview.models import ManagedServiceIdentity as RestManagedServiceIdentity -from azure.ai.ml._restclient.v2022_10_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import ManagedServiceIdentity as RestManagedServiceIdentity +from azure.ai.ml._restclient.arm_ml_service.models import ( ManagedServiceIdentityType as RestManagedServiceIdentityType, ) -from azure.ai.ml._restclient.v2022_10_01_preview.models import Registry as RestRegistry -from azure.ai.ml._restclient.v2022_10_01_preview.models import RegistryProperties +from azure.ai.ml._restclient.arm_ml_service.models import Registry as RestRegistry +from azure.ai.ml._restclient.arm_ml_service.models import RegistryProperties from azure.ai.ml._utils.utils import dump_yaml_to_file from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY from azure.ai.ml.entities._assets.intellectual_property import IntellectualProperty @@ -212,20 +212,24 @@ def _to_rest_object(self) -> RestRegistry: # managed resource group to manage their internal sub-resources. # We always want the tags on this MRG to match those of the registry itself # to keep janitor policies aligned. + registry_properties = RegistryProperties( + public_network_access=self.public_network_access, + discovery_url=self.discovery_url, + intellectual_property_publisher=( + (self.intellectual_property.publisher) if self.intellectual_property else None + ), + managed_resource_group=self.managed_resource_group, + ml_flow_registry_uri=self.mlflow_registry_uri, + region_details=replication_locations, + ) + # ``managed_resource_group_tags`` is not a typed field on the shared arm_ml_service + # RegistryProperties model (api-version 2025-12-01) but is part of the 2022-10-01-preview + # contract; set it via its wire key to preserve the old request body. + registry_properties["managedResourceGroupTags"] = self.tags return RestRegistry( name=self.name, location=self.location, identity=identity, tags=self.tags, - properties=RegistryProperties( - public_network_access=self.public_network_access, - discovery_url=self.discovery_url, - intellectual_property_publisher=( - (self.intellectual_property.publisher) if self.intellectual_property else None - ), - managed_resource_group=self.managed_resource_group, - ml_flow_registry_uri=self.mlflow_registry_uri, - region_details=replication_locations, - managed_resource_group_tags=self.tags, - ), + properties=registry_properties, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py index 5a108d7054fe..bb3c6e9e4530 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py @@ -8,15 +8,13 @@ from typing import List, Optional, Union from azure.ai.ml._exception_helper import log_and_raise_error -from azure.ai.ml._restclient.v2022_10_01_preview.models import AcrDetails as RestAcrDetails -from azure.ai.ml._restclient.v2022_10_01_preview.models import ArmResourceId as RestArmResourceId -from azure.ai.ml._restclient.v2022_10_01_preview.models import RegistryRegionArmDetails as RestRegistryRegionArmDetails -from azure.ai.ml._restclient.v2022_10_01_preview.models import StorageAccountDetails as RestStorageAccountDetails -from azure.ai.ml._restclient.v2022_10_01_preview.models import SystemCreatedAcrAccount as RestSystemCreatedAcrAccount -from azure.ai.ml._restclient.v2022_10_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import AcrDetails as RestAcrDetails +from azure.ai.ml._restclient.arm_ml_service.models import RegistryRegionArmDetails as RestRegistryRegionArmDetails +from azure.ai.ml._restclient.arm_ml_service.models import StorageAccountDetails as RestStorageAccountDetails +from azure.ai.ml._restclient.arm_ml_service.models import SystemCreatedAcrAccount as RestSystemCreatedAcrAccount +from azure.ai.ml._restclient.arm_ml_service.models import ( SystemCreatedStorageAccount as RestSystemCreatedStorageAccount, ) -from azure.ai.ml._restclient.v2022_10_01_preview.models import UserCreatedAcrAccount as RestUserCreatedAcrAccount from azure.ai.ml.constants._registry import StorageAccountType from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, ValidationErrorType, ValidationException @@ -64,9 +62,12 @@ def _to_rest_object(cls, acr: Union[str, "SystemCreatedAcrAccount"]) -> RestAcrD ) ) else: - return RestAcrDetails( - user_created_acr_account=RestUserCreatedAcrAccount(arm_resource_id=RestArmResourceId(resource_id=acr)) - ) + # ``UserCreatedAcrAccount`` was @removed from the shared arm_ml_service model + # (api-version 2025-12-01); set the wire field directly to preserve the old body: + # {"userCreatedAcrAccount": {"armResourceId": {"resourceId": }}}. + rest_acr = RestAcrDetails() + rest_acr["userCreatedAcrAccount"] = {"armResourceId": {"resourceId": acr}} + return rest_acr @classmethod def _from_rest_object(cls, rest_obj: RestAcrDetails) -> Optional["Union[str, SystemCreatedAcrAccount]"]: @@ -80,8 +81,9 @@ def _from_rest_object(cls, rest_obj: RestAcrDetails) -> Optional["Union[str, Sys acr_account_sku=rest_obj.system_created_acr_account.acr_account_sku, arm_resource_id=resource_id, ) - elif hasattr(rest_obj, "user_created_acr_account") and rest_obj.user_created_acr_account is not None: - res: Optional[str] = rest_obj.user_created_acr_account.arm_resource_id.resource_id + elif rest_obj.get("userCreatedAcrAccount") is not None: + user_created = rest_obj["userCreatedAcrAccount"] + res: Optional[str] = user_created["armResourceId"]["resourceId"] return res else: return None @@ -258,7 +260,9 @@ def _storage_config_from_rest_object( replicated_ids=replicated_ids, ) elif system_created_count == 0: - return [config.user_created_storage_account.arm_resource_id.resource_id for config in rest_configs] + # ``user_created_storage_account`` is not a typed field on the shared arm_ml_service + # StorageAccountDetails model (api-version 2025-12-01); read it via its wire key. + return [config["userCreatedStorageAccount"]["armResourceId"]["resourceId"] for config in rest_configs] else: msg = f"""tried reading in a registry whose storage accounts were not mono-managed or user-created. {system_created_count} out of {num_configs} were managed.""" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/util.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/util.py index 18f561697d04..eb269e685565 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/util.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/util.py @@ -2,16 +2,13 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -from azure.ai.ml._restclient.v2022_10_01_preview.models import ArmResourceId as RestArmResourceId -from azure.ai.ml._restclient.v2022_10_01_preview.models import StorageAccountDetails as RestStorageAccountDetails -from azure.ai.ml._restclient.v2022_10_01_preview.models import ( - UserCreatedStorageAccount as RestUserCreatedStorageAccount, -) +from azure.ai.ml._restclient.arm_ml_service.models import StorageAccountDetails as RestStorageAccountDetails def _make_rest_user_storage_from_id(*, user_id: str) -> RestStorageAccountDetails: - return RestStorageAccountDetails( - user_created_storage_account=RestUserCreatedStorageAccount( - arm_resource_id=RestArmResourceId(resource_id=user_id) - ) - ) + # ``UserCreatedStorageAccount`` was @removed from the shared arm_ml_service model + # (api-version 2025-12-01); set the wire field directly to preserve the old body: + # {"userCreatedStorageAccount": {"armResourceId": {"resourceId": }}}. + rest_storage = RestStorageAccountDetails() + rest_storage["userCreatedStorageAccount"] = {"armResourceId": {"resourceId": user_id}} + return rest_storage diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_schedule/schedule.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_schedule/schedule.py index 969bcf329c30..e446d1ee7681 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_schedule/schedule.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_schedule/schedule.py @@ -10,13 +10,12 @@ from typing_extensions import Literal -from azure.ai.ml._restclient.v2023_06_01_preview.models import JobBase as RestJobBase -from azure.ai.ml._restclient.v2023_06_01_preview.models import JobBaseProperties as RestJobBaseProperties -from azure.ai.ml._restclient.v2023_06_01_preview.models import JobScheduleAction -from azure.ai.ml._restclient.v2023_06_01_preview.models import PipelineJob as RestPipelineJob -from azure.ai.ml._restclient.v2023_06_01_preview.models import Schedule as RestSchedule -from azure.ai.ml._restclient.v2023_06_01_preview.models import ScheduleActionType as RestScheduleActionType -from azure.ai.ml._restclient.v2023_06_01_preview.models import ScheduleProperties +from azure.ai.ml._restclient.arm_ml_service.models import JobBase as RestJobBase +from azure.ai.ml._restclient.arm_ml_service.models import JobScheduleAction +from azure.ai.ml._restclient.arm_ml_service.models import PipelineJob as RestPipelineJob +from azure.ai.ml._restclient.arm_ml_service.models import Schedule as RestSchedule +from azure.ai.ml._restclient.arm_ml_service.models import ScheduleActionType as RestScheduleActionType +from azure.ai.ml._restclient.arm_ml_service.models import ScheduleProperties from azure.ai.ml._restclient.v2024_01_01_preview.models import TriggerRunSubmissionDto as RestTriggerRunSubmissionDto from azure.ai.ml._schema.schedule.schedule import JobScheduleSchema from azure.ai.ml._utils.utils import camel_to_snake, dump_yaml_to_file, is_private_preview_enabled @@ -164,15 +163,19 @@ def _from_rest_object(cls, obj: RestSchedule) -> "Schedule": from azure.ai.ml.entities._data_import.schedule import ImportDataSchedule from azure.ai.ml.entities._monitoring.schedule import MonitorSchedule - if obj.properties.action.action_type == RestScheduleActionType.CREATE_JOB: + # ``ImportData`` is not a member of the shared arm_ml_service ``ScheduleActionType`` enum (and the + # import-data action is carried as a plain wire dict), so compare the ``actionType`` wire value via + # mapping access -- this works for both the typed arm action models and the plain-dict action. + action_type = obj.properties.action["actionType"] + if action_type == RestScheduleActionType.CREATE_JOB: return JobSchedule._from_rest_object(obj) - if obj.properties.action.action_type == RestScheduleActionType.CREATE_MONITOR: + if action_type == RestScheduleActionType.CREATE_MONITOR: res_monitor_schedule: Schedule = MonitorSchedule._from_rest_object(obj) return res_monitor_schedule - if obj.properties.action.action_type == RestScheduleActionType.IMPORT_DATA: + if action_type == "ImportData": res_data_schedule: Schedule = ImportDataSchedule._from_rest_object(obj) return res_data_schedule - msg = f"Unsupported schedule type {obj.properties.action.action_type}" + msg = f"Unsupported schedule type {action_type}" raise ScheduleException( message=msg, no_personal_data_message=msg, @@ -429,11 +432,6 @@ def _to_rest_object(self) -> RestSchedule: job_definition.source_job_id = self.create_job.id elif private_enabled and isinstance(self.create_job, (CommandJob, SparkJob)): job_definition = self.create_job._to_rest_object().properties - # CommandJob builds a shared arm_ml_service hybrid envelope, but the schedule is serialized - # by the v2023_06 msrest client; convert the hybrid job_definition back to msrest (via its - # camelCase wire dict) so it carries the ``_attribute_map`` the msrest serializer needs. - if getattr(job_definition, "_is_model", False) is True: - job_definition = RestJobBaseProperties.deserialize(job_definition.as_dict()) # TODO: Merge this branch with PipelineJob after source job id move to JobBaseProperties # job_definition.source_job_id = self.create_job.id elif isinstance(self.create_job, str): # arm id reference @@ -441,6 +439,7 @@ def _to_rest_object(self) -> RestSchedule: # Rest pipeline job will hold a 'Default' as experiment_name, # MFE will add default if None, so pass an empty string here. job_definition = RestPipelineJob(source_job_id=self.create_job, experiment_name="") + job_definition["isArchived"] = False else: msg = "Unsupported job type '{}' in schedule {}." raise ValidationException( @@ -449,6 +448,12 @@ def _to_rest_object(self) -> RestSchedule: target=ErrorTarget.SCHEDULE, error_category=ErrorCategory.USER_ERROR, ) + # PipelineJob (v2024_01) and SparkJob (v2023_04) still build msrest job definitions, and the arm-id + # branch builds a msrest RestPipelineJob; CommandJob already builds the shared arm_ml_service hybrid. + # Convert any msrest job_definition to its camelCase wire dict so it fits inside the arm_ml_service + # schedule envelope without changing the wire body. + if getattr(job_definition, "_is_model", False) is not True: + job_definition = job_definition.serialize() return RestSchedule( properties=ScheduleProperties( description=self.description, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_schedule/trigger.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_schedule/trigger.py index 855aac9ec046..89fba06546a8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_schedule/trigger.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_schedule/trigger.py @@ -7,11 +7,11 @@ from datetime import datetime from typing import List, Optional, Union -from azure.ai.ml._restclient.v2023_04_01_preview.models import CronTrigger as RestCronTrigger -from azure.ai.ml._restclient.v2023_04_01_preview.models import RecurrenceSchedule as RestRecurrencePattern -from azure.ai.ml._restclient.v2023_04_01_preview.models import RecurrenceTrigger as RestRecurrenceTrigger -from azure.ai.ml._restclient.v2023_04_01_preview.models import TriggerBase as RestTriggerBase -from azure.ai.ml._restclient.v2023_04_01_preview.models import TriggerType as RestTriggerType +from azure.ai.ml._restclient.arm_ml_service.models import CronTrigger as RestCronTrigger +from azure.ai.ml._restclient.arm_ml_service.models import RecurrenceSchedule as RestRecurrencePattern +from azure.ai.ml._restclient.arm_ml_service.models import RecurrenceTrigger as RestRecurrenceTrigger +from azure.ai.ml._restclient.arm_ml_service.models import TriggerBase as RestTriggerBase +from azure.ai.ml._restclient.arm_ml_service.models import TriggerType as RestTriggerType from azure.ai.ml._utils.utils import camel_to_snake, snake_to_camel from azure.ai.ml.constants import TimeZone from azure.ai.ml.entities._mixins import RestTranslatableMixin @@ -19,6 +19,23 @@ module_logger = logging.getLogger(__name__) +def _format_trigger_time(value: Optional[Union[str, datetime]]) -> Optional[Union[str, datetime]]: + """Match the legacy (pre-arm) wire format for trigger start/end times. + + The old msrest models serialized a ``datetime`` as ``"%Y-%m-%d %H:%M:%S"`` (space-separated), while the + shared arm_ml_service models serialize it as ISO ``"...T...Z"``. Format datetimes to the legacy string + so the wire body is unchanged; strings are passed through untouched. + + :param value: A start/end time as str or datetime. + :type value: Optional[Union[str, datetime]] + :return: The legacy-format string (for datetimes) or the original value. + :rtype: Optional[Union[str, datetime]] + """ + if isinstance(value, datetime): + return value.strftime("%Y-%m-%d %H:%M:%S") + return value + + class TriggerBase(RestTranslatableMixin, ABC): """Base class of Trigger. @@ -173,23 +190,23 @@ def __init__( ) self.expression = expression - def _to_rest_object(self) -> RestCronTrigger: # v2022_12_01.models.CronTrigger + def _to_rest_object(self) -> RestCronTrigger: # v2023_04_01_preview.models.CronTrigger return RestCronTrigger( trigger_type=self.type, expression=self.expression, - start_time=self.start_time, - end_time=self.end_time, + start_time=_format_trigger_time(self.start_time), + end_time=_format_trigger_time(self.end_time), time_zone=self.time_zone, ) - def _to_rest_compute_cron_object(self) -> RestCronTrigger: # v2022_12_01_preview.models.CronTrigger + def _to_rest_compute_cron_object(self) -> RestCronTrigger: # v2023_04_01_preview.models.CronTrigger # This function is added because we can't make compute trigger to use same class # with schedule from service side. if self.end_time: module_logger.warning("'end_time' is ignored for not supported on compute schedule.") return RestCronTrigger( expression=self.expression, - start_time=self.start_time, + start_time=_format_trigger_time(self.start_time), time_zone=self.time_zone, ) @@ -254,18 +271,18 @@ def __init__( self.frequency = frequency self.interval = interval - def _to_rest_object(self) -> RestRecurrenceTrigger: # v2022_12_01.models.RecurrenceTrigger + def _to_rest_object(self) -> RestRecurrenceTrigger: # v2023_04_01_preview.models.RecurrenceTrigger return RestRecurrenceTrigger( frequency=snake_to_camel(self.frequency), interval=self.interval, schedule=self.schedule._to_rest_object(), - start_time=self.start_time, - end_time=self.end_time, + start_time=_format_trigger_time(self.start_time), + end_time=_format_trigger_time(self.end_time), time_zone=self.time_zone, ) def _to_rest_compute_recurrence_object(self) -> RestRecurrenceTrigger: - # v2022_12_01_preview.models.RecurrenceTrigger + # v2023_04_01_preview.models.RecurrenceTrigger # This function is added because we can't make compute trigger to use same class # with schedule from service side. if self.end_time: @@ -274,7 +291,7 @@ def _to_rest_compute_recurrence_object(self) -> RestRecurrenceTrigger: frequency=snake_to_camel(self.frequency), interval=self.interval, schedule=self.schedule._to_rest_compute_pattern_object(), - start_time=self.start_time, + start_time=_format_trigger_time(self.start_time), time_zone=self.time_zone, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/compute_runtime.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/compute_runtime.py index bc7ee1278377..96e611eb317d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/compute_runtime.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/compute_runtime.py @@ -4,7 +4,7 @@ from typing import Optional -from azure.ai.ml._restclient.v2023_06_01_preview.models import ComputeRuntimeDto as RestComputeRuntimeDto +from azure.ai.ml._restclient.arm_ml_service.models import ComputeRuntimeDto as RestComputeRuntimeDto from azure.ai.ml.entities._mixins import RestTranslatableMixin diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py index 9fcdeaf7ae1f..a5c5d5f3b626 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py @@ -23,7 +23,6 @@ from azure.ai.ml._restclient.v2021_10_01_dataplanepreview import ( AzureMachineLearningWorkspaces as ServiceClient102021Dataplane, ) -from azure.ai.ml._restclient.v2022_10_01_preview import AzureMachineLearningWorkspaces as ServiceClient102022 from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient042023 from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationScope, _ScopeDependentOperations from azure.ai.ml._telemetry import ActivityType, monitor_with_activity @@ -65,7 +64,6 @@ class CodeOperations(_ScopeDependentOperations): :type operation_config: ~azure.ai.ml._scope_dependent_operations.OperationConfig :param service_client: Service client to allow end users to operate on Azure Machine Learning Workspace resources. :type service_client: typing.Union[ - ~azure.ai.ml._restclient.v2022_10_01_preview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, ~azure.ai.ml._restclient.v2021_10_01_dataplanepreview._azure_machine_learning_workspaces. AzureMachineLearningWorkspaces, ~azure.ai.ml._restclient.arm_ml_service.MachineLearningServicesMgmtClient] @@ -77,7 +75,7 @@ def __init__( self, operation_scope: OperationScope, operation_config: OperationConfig, - service_client: Union[ServiceClient102022, ServiceClient102021Dataplane, ServiceClient042023], + service_client: Union[ServiceClient102021Dataplane, ServiceClient042023], datastore_operations: DatastoreOperations, **kwargs: Dict, ): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_compute_operations.py index 7990a3fa1e31..7ab7db73ec6e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_compute_operations.py @@ -34,7 +34,7 @@ class ComputeOperations(_ScopeDependentOperations): :type operation_config: ~azure.ai.ml._scope_dependent_operations.OperationConfig :param service_client: Service client to allow end users to operate on Azure Machine Learning Workspace resources. - :type service_client: ~azure.ai.ml._restclient.v2023_02_01_preview.AzureMachineLearningWorkspaces + :type service_client: ~azure.ai.ml._restclient.arm_ml_service.MachineLearningServicesMgmtClient """ def __init__( 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 4fcd48e10f78..386dafa2ca94 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 @@ -204,7 +204,7 @@ class JobOperations(_ScopeDependentOperations): :type operation_config: ~azure.ai.ml._scope_dependent_operations.OperationConfig :param service_client_02_2023_preview: Service client to allow end users to operate on Azure Machine Learning Workspace resources. - :type service_client_02_2023_preview: ~azure.ai.ml._restclient.v2023_02_01_preview.AzureMachineLearningWorkspaces + :type service_client_02_2023_preview: ~azure.ai.ml._restclient.arm_ml_service.MachineLearningServicesMgmtClient :param all_operations: All operations classes of an MLClient object. :type all_operations: ~azure.ai.ml._scope_dependent_operations.OperationsContainer :param credential: Credential to use for authentication. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py index 6cd1a326049a..e202cd0eadcf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py @@ -4,9 +4,13 @@ # pylint: disable=protected-access,unused-argument -from typing import Dict, Iterable, Optional, cast +import json +from typing import Any, Dict, Iterable, Optional, cast -from azure.ai.ml._restclient.v2022_10_01_preview import AzureMachineLearningWorkspaces as ServiceClient102022 +from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient102022 +from azure.ai.ml._restclient.arm_ml_service._utils.model_base import SdkJSONEncoder +from azure.ai.ml._restclient.arm_ml_service.models import Registry as RestRegistry +from azure.ai.ml._restclient.arm_ml_service.operations._operations import build_registries_create_or_update_request 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 @@ -141,14 +145,39 @@ def begin_create( :rtype: LROPoller """ registry_data = registry._to_rest_object() - poller = self._operation.begin_create_or_update( + # The shared arm_ml_service ``begin_create_or_update`` was generated against an api-version whose + # registry-create swagger declares only 200/201 as terminal initial statuses, so it raises on the + # 202 Accepted the service actually returns for this LRO. We send the create request ourselves, + # accept 202, and drive our own poller (mirrors how we build the request body as a dict). + registries_op = self._operation + client = registries_op._client + config = registries_op._config + content = json.dumps(registry_data, cls=SdkJSONEncoder, exclude_readonly=True) + request = build_registries_create_or_update_request( resource_group_name=self._resource_group_name, registry_name=registry.name, - body=registry_data, - polling=self._get_polling(str(registry.name)), - cls=lambda response, deserialized, headers: Registry._from_rest_object(deserialized), + subscription_id=config.subscription_id, + content_type="application/json", + api_version=config.api_version, + content=content, + ) + path_format_arguments = {"endpoint": config.base_url} + request.url = client.format_url(request.url, **path_format_arguments) + initial_response = client._pipeline.run(request, stream=False) + status = initial_response.http_response.status_code + if status not in (200, 201, 202): + initial_response.http_response.raise_for_status() + + def _get_long_running_output(pipeline_response: Any) -> Registry: + rest_registry = RestRegistry._deserialize(pipeline_response.http_response.json(), []) + return Registry._from_rest_object(rest_registry) # type: ignore[return-value] + + poller: LROPoller = LROPoller( + client, + initial_response, + _get_long_running_output, + self._get_polling(str(registry.name)), ) - return poller @monitor_with_activity(ops_logger, "Registry.BeginDelete", ActivityType.PUBLICAPI) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_schedule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_schedule_operations.py index eab67493eec0..0511fe061025 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_schedule_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_schedule_operations.py @@ -5,7 +5,7 @@ from datetime import datetime, timezone from typing import Any, Iterable, List, Optional, Tuple, cast -from azure.ai.ml._restclient.v2023_06_01_preview import AzureMachineLearningWorkspaces as ServiceClient062023Preview +from azure.ai.ml._restclient.arm_ml_service import MachineLearningServicesMgmtClient as ServiceClient062023Preview from azure.ai.ml._restclient.v2024_01_01_preview import AzureMachineLearningWorkspaces as ServiceClient012024Preview from azure.ai.ml._scope_dependent_operations import ( OperationConfig, diff --git a/sdk/ml/azure-ai-ml/tests/component/unittests/test_spark_component_entity.py b/sdk/ml/azure-ai-ml/tests/component/unittests/test_spark_component_entity.py index 81e7ed816451..0d233d59989d 100644 --- a/sdk/ml/azure-ai-ml/tests/component/unittests/test_spark_component_entity.py +++ b/sdk/ml/azure-ai-ml/tests/component/unittests/test_spark_component_entity.py @@ -2,7 +2,6 @@ import pytest from azure.ai.ml import load_component -from azure.ai.ml._restclient.v2022_10_01_preview.models import ManagedIdentity from azure.ai.ml._utils.utils import load_yaml from azure.ai.ml.entities._component.spark_component import SparkComponent from azure.ai.ml.entities._job.pipeline._io import PipelineInput diff --git a/sdk/ml/azure-ai-ml/tests/compute/unittests/test_compute_entity.py b/sdk/ml/azure-ai-ml/tests/compute/unittests/test_compute_entity.py index 254e88aad8a2..f4632b0e1a8c 100644 --- a/sdk/ml/azure-ai-ml/tests/compute/unittests/test_compute_entity.py +++ b/sdk/ml/azure-ai-ml/tests/compute/unittests/test_compute_entity.py @@ -1,14 +1,15 @@ +import json from datetime import timedelta from typing import List, Union import pytest import yaml -from msrest import Serializer from test_utilities.utils import verify_entity_load_and_dump from azure.ai.ml import load_compute +from azure.ai.ml._restclient.arm_ml_service._utils.model_base import SdkJSONEncoder +from azure.ai.ml._restclient.arm_ml_service.models import ComputeResource, ImageMetadata from azure.ai.ml._restclient.v2023_04_01_preview.models import DataFactory -from azure.ai.ml._restclient.v2023_08_01_preview.models import ComputeResource, ImageMetadata from azure.ai.ml.constants._compute import CustomApplicationDefaults from azure.ai.ml.entities import ( AmlCompute, @@ -22,6 +23,11 @@ ) +def _to_wire(rest_obj): + """Serialize an arm_ml_service hybrid REST object to its camelCase wire body.""" + return json.loads(json.dumps(rest_obj, cls=SdkJSONEncoder, exclude_readonly=True)) + + @pytest.mark.unittest @pytest.mark.core_sdk_test class TestComputeEntity: @@ -81,10 +87,11 @@ def test_compute_from_yaml(self): assert rest_intermediate.properties.disable_local_auth is False assert rest_intermediate.properties.properties.scale_settings.max_node_count == 2 assert rest_intermediate.properties.properties.scale_settings.min_node_count == 0 - assert rest_intermediate.properties.properties.scale_settings.node_idle_time_before_scale_down == "PT1M40S" + assert rest_intermediate.properties.properties.scale_settings.node_idle_time_before_scale_down == timedelta( + seconds=100 + ) - serializer = Serializer({"ComputeResource": ComputeResource}) - body = serializer.body(rest_intermediate, "ComputeResource") + body = _to_wire(rest_intermediate) assert body["identity"]["type"] == "UserAssigned" assert body["identity"]["userAssignedIdentities"] == self._uai_list_to_dict( compute.identity.user_assigned_identities @@ -108,7 +115,9 @@ def test_aml_compute_from_yaml_with_disable_public_access(self): assert rest_intermediate.properties.properties.remote_login_port_public_access == "NotSpecified" assert rest_intermediate.properties.properties.scale_settings.max_node_count == 4 assert rest_intermediate.properties.properties.scale_settings.min_node_count == 0 - assert rest_intermediate.properties.properties.scale_settings.node_idle_time_before_scale_down == "PT2M" + assert rest_intermediate.properties.properties.scale_settings.node_idle_time_before_scale_down == timedelta( + seconds=120 + ) def test_aml_compute_from_yaml_with_creds_and_disable_public_access(self): compute: AmlCompute = load_compute("tests/test_configs/compute/compute-aml-no-identity.yaml") @@ -157,8 +166,7 @@ def test_compute_vm_from_yaml(self): assert rest_intermediate.properties.properties.administrator_account.username == "azureuser" assert rest_intermediate.properties.properties.administrator_account.private_key_data == fake_key - serializer = Serializer({"ComputeResource": ComputeResource}) - body = serializer.body(rest_intermediate, "ComputeResource") + body = _to_wire(rest_intermediate) assert body["properties"]["resourceId"] == resource_id assert body["properties"]["properties"]["sshPort"] == 8888 assert body["properties"]["properties"]["administratorAccount"]["username"] == "azureuser" @@ -210,9 +218,60 @@ def test_compute_instance_load_from_rest(self): )._to_rest_object() assert compute_instance3.properties.compute_type == "ComputeInstance" assert compute_instance3.properties.properties.enable_sso is True - assert compute_instance3.properties.properties.enable_root_access is True - assert compute_instance3.properties.properties.enable_os_patching is False - assert compute_instance3.properties.properties.release_quota_on_stop is False + assert compute_instance3.properties.properties.get("enableRootAccess") is True + assert compute_instance3.properties.properties.get("enableOSPatching") is False + assert compute_instance3.properties.properties.get("releaseQuotaOnStop") is False + + def test_compute_instance_from_msrest_response(self): + # The compute operations layer deserializes the real GET/list response with the v2023_08 msrest + # client, so ``_from_rest_object`` must read the 2023-08 typed attributes (enableRootAccess / + # releaseQuotaOnStop / enableOSPatching) -- not only the arm-hybrid wire keys produced by the + # entity's own ``_to_rest_object`` round-trip. Guards the read path that only e2e exercised. + from azure.ai.ml._restclient.v2023_08_01_preview.models import ( + ComputeInstance as MsrestComputeInstance, + ComputeInstanceProperties as MsrestComputeInstanceProperties, + ComputeResource as MsrestComputeResource, + ) + + rest = MsrestComputeResource( + name="ci-from-service", + location="eastus", + properties=MsrestComputeInstance( + properties=MsrestComputeInstanceProperties( + vm_size="STANDARD_DS3_V2", + enable_root_access=False, + release_quota_on_stop=True, + enable_os_patching=True, + ), + ), + ) + + instance = ComputeInstance._from_rest_object(rest) + assert instance.enable_root_access is False + assert instance.release_quota_on_stop is True + assert instance.enable_os_patching is True + + def test_aml_compute_from_msrest_response(self): + # ``AmlCompute._load_from_rest`` reads ``createdOn`` from the msrest ``additional_properties`` bag + # (the v2023_08 response carries it as an undeclared field). Guards against assuming the arm-hybrid + # mapping shape on the real ops response. + from azure.ai.ml._restclient.v2023_08_01_preview.models import ( + AmlCompute as MsrestAmlCompute, + AmlComputeProperties as MsrestAmlComputeProperties, + ComputeResource as MsrestComputeResource, + ) + + rest = MsrestComputeResource( + name="aml-from-service", + location="eastus", + properties=MsrestAmlCompute( + properties=MsrestAmlComputeProperties(vm_size="STANDARD_DS3_V2"), + ), + ) + rest.properties.additional_properties = {"createdOn": "2026-01-01T00:00:00.000Z"} + + compute = AmlCompute._load_from_rest(rest) + assert compute.created_on == "2026-01-01T00:00:00.000Z" def test_compute_instance_with_image_metadata(self): os_image_metadata = ImageMetadata( @@ -429,8 +488,7 @@ def test_synapsespark_compute_from_yaml(self): rest_intermediate = compute._to_rest_object() assert rest_intermediate.properties.compute_type == "SynapseSpark" - serializer = Serializer({"ComputeResource": ComputeResource}) - body = serializer.body(rest_intermediate, "ComputeResource") + body = _to_wire(rest_intermediate) assert body["identity"]["type"] == "UserAssigned" assert body["identity"]["userAssignedIdentities"] == self._uai_list_to_dict( compute.identity.user_assigned_identities diff --git a/sdk/ml/azure-ai-ml/tests/compute/unittests/test_compute_operations.py b/sdk/ml/azure-ai-ml/tests/compute/unittests/test_compute_operations.py index 6640c5704ed1..a1bcff924a12 100644 --- a/sdk/ml/azure-ai-ml/tests/compute/unittests/test_compute_operations.py +++ b/sdk/ml/azure-ai-ml/tests/compute/unittests/test_compute_operations.py @@ -23,13 +23,13 @@ def mock_compute_operation( mock_workspace_scope: OperationScope, mock_operation_config: OperationConfig, - mock_aml_services_2022_10_01_preview: Mock, + mock_aml_services_2023_08_01_preview: Mock, mock_aml_services_2023_04_01_preview: Mock, ) -> ComputeOperations: yield ComputeOperations( operation_scope=mock_workspace_scope, operation_config=mock_operation_config, - service_client=mock_aml_services_2022_10_01_preview, + service_client=mock_aml_services_2023_08_01_preview, service_client_2024=mock_aml_services_2023_04_01_preview, ) diff --git a/sdk/ml/azure-ai-ml/tests/conftest.py b/sdk/ml/azure-ai-ml/tests/conftest.py index fdf164978dc6..531947f3b83d 100644 --- a/sdk/ml/azure-ai-ml/tests/conftest.py +++ b/sdk/ml/azure-ai-ml/tests/conftest.py @@ -266,19 +266,9 @@ def mock_aml_services_2021_10_01_dataplanepreview(mocker: MockFixture) -> Mock: return mocker.patch("azure.ai.ml._restclient.v2021_10_01_dataplanepreview") -@pytest.fixture -def mock_aml_services_2022_10_01_preview(mocker: MockFixture) -> Mock: - return mocker.patch("azure.ai.ml._restclient.v2022_10_01_preview") - - -@pytest.fixture -def mock_aml_services_2022_12_01_preview(mocker: MockFixture) -> Mock: - return mocker.patch("azure.ai.ml._restclient.v2022_12_01_preview") - - @pytest.fixture def mock_aml_services_2023_02_01_preview(mocker: MockFixture) -> Mock: - return mocker.patch("azure.ai.ml._restclient.v2023_02_01_preview") + return mocker.patch("azure.ai.ml._restclient.arm_ml_service") @pytest.fixture @@ -288,7 +278,7 @@ def mock_aml_services_2023_04_01_preview(mocker: MockFixture) -> Mock: @pytest.fixture def mock_aml_services_2023_06_01_preview(mocker: MockFixture) -> Mock: - return mocker.patch("azure.ai.ml._restclient.v2023_06_01_preview") + return mocker.patch("azure.ai.ml._restclient.arm_ml_service") @pytest.fixture diff --git a/sdk/ml/azure-ai-ml/tests/monitoring/unittests/test_monitor_schedule.py b/sdk/ml/azure-ai-ml/tests/monitoring/unittests/test_monitor_schedule.py index 86202afc8486..94446a748a63 100644 --- a/sdk/ml/azure-ai-ml/tests/monitoring/unittests/test_monitor_schedule.py +++ b/sdk/ml/azure-ai-ml/tests/monitoring/unittests/test_monitor_schedule.py @@ -1,4 +1,5 @@ import json +from datetime import timedelta import yaml import pytest @@ -6,14 +7,14 @@ from azure.ai.ml.entities._monitoring.schedule import MonitorSchedule from azure.ai.ml.entities._schedule.schedule import Schedule from azure.ai.ml.entities._load_functions import load_schedule -from azure.ai.ml._restclient.v2023_06_01_preview.models import Schedule as RestSchedule +from azure.ai.ml._restclient.arm_ml_service.models import Schedule as RestSchedule def validate_to_from_rest_translation(json_path: str, yaml_path: str) -> None: with open(json_path, "r") as f: loaded_json = json.load(f) - deserialized_schedule = RestSchedule.deserialize(loaded_json) + deserialized_schedule = RestSchedule._deserialize(loaded_json, []) monitor_schedule = load_schedule(yaml_path) @@ -110,5 +111,7 @@ def override_frequency_interval_and_check_window_size( signal.production_data.data_window.lookback_window_size = None to_rest_schedule = schedule._to_rest_object() + # arm_ml_service hybrid models keep ``window_size`` as a timedelta (the wire serializes it to + # ``P{days}D``); navigate the camelCase monitor definition and compare the in-memory duration. for signal in to_rest_schedule.properties.action.monitor_definition.signals.values(): - assert signal.production_data.window_size == f"P{expected_days}D" + assert signal.production_data.window_size == timedelta(days=expected_days) diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_entity.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_entity.py index 975b8577cdf4..37569a9c3bf3 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_entity.py +++ b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_entity.py @@ -1,17 +1,16 @@ import pytest -from azure.ai.ml._restclient.v2022_10_01_preview.models import AcrDetails -from azure.ai.ml._restclient.v2022_10_01_preview.models import ArmResourceId as RestArmResourceId -from azure.ai.ml._restclient.v2022_10_01_preview.models import Registry as RestRegistry -from azure.ai.ml._restclient.v2022_10_01_preview.models import RegistryProperties -from azure.ai.ml._restclient.v2022_10_01_preview.models import RegistryRegionArmDetails as RestRegistryRegionArmDetails -from azure.ai.ml._restclient.v2022_10_01_preview.models import StorageAccountDetails -from azure.ai.ml._restclient.v2022_10_01_preview.models import StorageAccountType as RestStorageAccountType -from azure.ai.ml._restclient.v2022_10_01_preview.models import SystemCreatedAcrAccount as RestSystemCreatedAcrAccount -from azure.ai.ml._restclient.v2022_10_01_preview.models import ( +from azure.ai.ml._restclient.arm_ml_service.models import AcrDetails +from azure.ai.ml._restclient.arm_ml_service.models import ArmResourceId as RestArmResourceId +from azure.ai.ml._restclient.arm_ml_service.models import Registry as RestRegistry +from azure.ai.ml._restclient.arm_ml_service.models import RegistryProperties +from azure.ai.ml._restclient.arm_ml_service.models import RegistryRegionArmDetails as RestRegistryRegionArmDetails +from azure.ai.ml._restclient.arm_ml_service.models import StorageAccountDetails +from azure.ai.ml._restclient.arm_ml_service.models import StorageAccountType as RestStorageAccountType +from azure.ai.ml._restclient.arm_ml_service.models import SystemCreatedAcrAccount as RestSystemCreatedAcrAccount +from azure.ai.ml._restclient.arm_ml_service.models import ( SystemCreatedStorageAccount as RestSystemCreatedStorageAccount, ) -from azure.ai.ml._restclient.v2022_10_01_preview.models import UserCreatedAcrAccount from azure.ai.ml.constants._registry import StorageAccountType # from azure.ai.ml.entities._util import load_from_dict @@ -45,6 +44,13 @@ hns = False +def _user_created_acr(resource_id): + """Build an arm_ml_service AcrDetails carrying a user-created ACR via its untyped wire field.""" + acr = AcrDetails() + acr["userCreatedAcrAccount"] = {"armResourceId": {"resourceId": resource_id}} + return acr + + @pytest.mark.unittest @pytest.mark.production_experiences_test class TestRegistryEntity: @@ -65,7 +71,6 @@ def test_deserialize_from_autorest_object(self) -> None: name=name, id="registry id", properties=RegistryProperties( - tags=interior_tags, public_network_access=pna, discovery_url=discovery_url, intellectual_property_publisher=ipp, @@ -75,11 +80,7 @@ def test_deserialize_from_autorest_object(self) -> None: RestRegistryRegionArmDetails( location=loc_2, acr_details=[ - AcrDetails( - user_created_acr_account=UserCreatedAcrAccount( - arm_resource_id=RestArmResourceId(resource_id=acr_id_1) - ) - ), + _user_created_acr(acr_id_1), AcrDetails( system_created_acr_account=RestSystemCreatedAcrAccount( acr_account_sku=sku, arm_resource_id=RestArmResourceId(resource_id=acr_id_2) @@ -165,7 +166,8 @@ def test_system_acr_serialization(self): assert isinstance(rest_user_acr, AcrDetails) assert isinstance(rest_system_acr, AcrDetails) - assert rest_user_acr.user_created_acr_account.arm_resource_id.resource_id == "some user id" + # ``userCreatedAcrAccount`` is an untyped wire field on the arm_ml_service AcrDetails model. + assert rest_user_acr["userCreatedAcrAccount"]["armResourceId"]["resourceId"] == "some user id" # Ensure that arm_resource_id is never set by entity->rest converter. assert rest_system_acr.system_created_acr_account.arm_resource_id == None assert rest_system_acr.system_created_acr_account.acr_account_sku == "Premium" @@ -185,7 +187,10 @@ def test_system_user_storage_serialization(self): user_details = RegistryRegionDetails(storage_config=user_storage) rest_user_storage = user_details._storage_config_to_rest_object() assert len(rest_user_storage) == 1 - assert rest_user_storage[0].user_created_storage_account.arm_resource_id.resource_id == "some user storage id" + # ``userCreatedStorageAccount`` is an untyped wire field on the arm_ml_service model. + assert ( + rest_user_storage[0]["userCreatedStorageAccount"]["armResourceId"]["resourceId"] == "some user storage id" + ) new_user_storage = RegistryRegionDetails._storage_config_from_rest_object(rest_user_storage) assert new_user_storage[0] == "some user storage id" diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py index 58863fec7095..575f4e01bc42 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py +++ b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py @@ -59,8 +59,15 @@ def test_create(self, mock_registry_operation: RegistryOperations, randstr: Call source="./tests/test_configs/registry/registry_valid_min.yaml", params_override=params_override ) # valid creation of new registry - mock_registry_operation.begin_create(registry=reg) - mock_registry_operation._operation.begin_create_or_update.assert_called_once() + mock_registry_operation._operation._client._pipeline.run.return_value = Mock( + http_response=Mock(status_code=200) + ) + with patch("azure.ai.ml.operations._registry_operations.LROPoller"): + mock_registry_operation.begin_create(registry=reg) + # begin_create sends the create request via the client pipeline directly (custom poller that + # accepts the 202 the service returns), not the generated begin_create_or_update which only + # accepts 200/201. + mock_registry_operation._operation._client._pipeline.run.assert_called_once() def test_delete(self, mock_registry_operation: RegistryOperations, randstr: Callable[[], str]) -> None: mock_registry_operation.begin_delete(name="some registry") diff --git a/sdk/ml/azure-ai-ml/tests/schedule/e2etests/test_schedule.py b/sdk/ml/azure-ai-ml/tests/schedule/e2etests/test_schedule.py index c24a055eedb3..790b4261808e 100644 --- a/sdk/ml/azure-ai-ml/tests/schedule/e2etests/test_schedule.py +++ b/sdk/ml/azure-ai-ml/tests/schedule/e2etests/test_schedule.py @@ -98,7 +98,7 @@ def test_load_cron_schedule_with_arm_id(self, client: MLClient, randstr: Callabl # Set to None to align with yaml as service will fill this rest_schedule.trigger.start_time = None assert ( - pydash.omit(rest_schedule.trigger._to_rest_object().as_dict(), "start_time") + pydash.omit(rest_schedule.trigger._to_rest_object().as_dict(), "startTime") == CronTrigger(time_zone="UTC", expression="15 10 * * 1")._to_rest_object().as_dict() ) @@ -141,10 +141,10 @@ def test_load_recurrence_schedule_no_pattern(self, client: MLClient, randstr: Ca assert rest_schedule.name == schedule.name client.schedules.begin_disable(schedule.name) assert rest_schedule.trigger._to_rest_object().as_dict() == { - "end_time": TRIGGER_ENDTIME, - "start_time": "2022-05-10 10:15:00", - "time_zone": "Pacific Standard Time", - "trigger_type": "Recurrence", + "endTime": TRIGGER_ENDTIME, + "startTime": "2022-05-10 10:15:00", + "timeZone": "Pacific Standard Time", + "triggerType": "Recurrence", "frequency": "day", "interval": 1, "schedule": {"hours": [], "minutes": []}, @@ -161,12 +161,12 @@ def test_load_recurrence_schedule_with_pattern(self, client: MLClient, randstr: assert rest_schedule.name == schedule.name client.schedules.begin_disable(schedule.name) assert rest_schedule.trigger._to_rest_object().as_dict() == { - "start_time": "2022-05-10 10:15:00", - "time_zone": "Pacific Standard Time", - "trigger_type": "Recurrence", + "startTime": "2022-05-10 10:15:00", + "timeZone": "Pacific Standard Time", + "triggerType": "Recurrence", "frequency": "week", "interval": 1, - "schedule": {"hours": [10], "minutes": [15], "week_days": ["Monday"]}, + "schedule": {"hours": [10], "minutes": [15], "weekDays": ["Monday"]}, } def test_create_schedule_pipeline_with_output_binding(self, client: MLClient, randstr: Callable[[], str]): diff --git a/sdk/ml/azure-ai-ml/tests/schedule/unittests/test_schedule_entity.py b/sdk/ml/azure-ai-ml/tests/schedule/unittests/test_schedule_entity.py index caa14b98c093..56d201f8b352 100644 --- a/sdk/ml/azure-ai-ml/tests/schedule/unittests/test_schedule_entity.py +++ b/sdk/ml/azure-ai-ml/tests/schedule/unittests/test_schedule_entity.py @@ -3,7 +3,7 @@ import pytest from test_utilities.utils import verify_entity_load_and_dump -from azure.ai.ml._restclient.v2023_06_01_preview.models import JobBaseProperties as RestJobBaseProperties +from azure.ai.ml._restclient.arm_ml_service.models import JobBaseProperties as RestJobBaseProperties from azure.ai.ml.constants import TimeZone from azure.ai.ml.entities import CronTrigger, JobSchedule, PipelineJob, RecurrencePattern, RecurrenceTrigger from azure.ai.ml.entities._load_functions import load_job, load_schedule @@ -28,18 +28,18 @@ def simple_schedule_validation(schedule): schedule.properties["test"] = "val" actual_dict = schedule._to_rest_object().as_dict()["properties"] # Skip job definition - actual_dict["action"]["job_definition"] = {} + actual_dict["action"]["jobDefinition"] = {} expected_dict = { "description": "a weekly retrain schedule", "properties": {"test": "val"}, "tags": {}, - "action": {"action_type": "CreateJob", "job_definition": {}}, - "display_name": "weekly retrain schedule", + "action": {"actionType": "CreateJob", "jobDefinition": {}}, + "displayName": "weekly retrain schedule", "trigger": { - "end_time": "2022-06-10 10:15:00", - "start_time": "2022-03-10 10:15:00", - "time_zone": "Pacific Standard Time", - "trigger_type": "Cron", + "endTime": "2022-06-10 10:15:00", + "startTime": "2022-03-10 10:15:00", + "timeZone": "Pacific Standard Time", + "triggerType": "Cron", "expression": "15 10 * * 1", }, } @@ -54,16 +54,16 @@ def test_load_cron_schedule_with_job_reference(self): "properties": {}, "tags": {}, "action": { - "action_type": "CreateJob", - "job_definition": { - "experiment_name": "", - "is_archived": False, - "job_type": "Pipeline", - "source_job_id": "/subscriptions/d511f82f-71ba-49a4-8233-d7be8a3650f4/resourceGroups/RLTesting/providers/Microsoft.MachineLearningServices/workspaces/AnkitWS/jobs/test_617704734544", + "actionType": "CreateJob", + "jobDefinition": { + "experimentName": "", + "isArchived": False, + "jobType": "Pipeline", + "sourceJobId": "/subscriptions/d511f82f-71ba-49a4-8233-d7be8a3650f4/resourceGroups/RLTesting/providers/Microsoft.MachineLearningServices/workspaces/AnkitWS/jobs/test_617704734544", }, }, - "display_name": "weekly retrain schedule", - "trigger": {"time_zone": "UTC", "trigger_type": "Cron", "expression": "15 10 * * 1"}, + "displayName": "weekly retrain schedule", + "trigger": {"timeZone": "UTC", "triggerType": "Cron", "expression": "15 10 * * 1"}, } def test_create_schedule_entity(self): @@ -92,10 +92,10 @@ def test_create_recurrence_trigger_no_pattern(self): trigger = RecurrenceTrigger(frequency="day", interval=1, start_time=start_time, end_time=end_time) assert trigger.schedule is not None assert trigger._to_rest_object().as_dict() == { - "end_time": "2022-06-10 10:15:00", - "start_time": "2022-03-10 10:15:00", - "time_zone": "UTC", - "trigger_type": "Recurrence", + "endTime": "2022-06-10 10:15:00", + "startTime": "2022-03-10 10:15:00", + "timeZone": "UTC", + "triggerType": "Recurrence", "frequency": "day", "interval": 1, "schedule": {"hours": [], "minutes": []}, @@ -110,13 +110,13 @@ def test_create_recurrence_trigger_with_pattern(self): ) assert trigger.schedule is not None assert trigger._to_rest_object().as_dict() == { - "end_time": "2022-06-10 10:15:00", + "endTime": "2022-06-10 10:15:00", "frequency": "day", "interval": 1, - "schedule": {"hours": [1, 3, 4, 5], "minutes": [0], "week_days": ["tuesday", "thursday"]}, - "start_time": "2022-03-10 10:15:00", - "time_zone": "UTC", - "trigger_type": "Recurrence", + "schedule": {"hours": [1, 3, 4, 5], "minutes": [0], "weekDays": ["tuesday", "thursday"]}, + "startTime": "2022-03-10 10:15:00", + "timeZone": "UTC", + "triggerType": "Recurrence", } @pytest.mark.usefixtures( @@ -128,26 +128,23 @@ def test_schedule_with_command_job(self): inner_job_path = "./tests/test_configs/command_job/command_job_test.yml" inner_job = load_job(inner_job_path)._to_job() schedule = load_schedule(test_path) - rest_schedule_job_dict = schedule._to_rest_object().as_dict()["properties"]["action"]["job_definition"] - # CommandJob builds a shared arm_ml_service hybrid envelope (camelCase as_dict), but the schedule - # embeds it as a v2023_06 msrest job_definition; normalize the standalone job the same way so the - # snake_case dicts compare equal. - loaded_job_dict = RestJobBaseProperties.deserialize( - inner_job._to_rest_object().as_dict()["properties"] - ).as_dict() + rest_schedule_job_dict = schedule._to_rest_object().as_dict()["properties"]["action"]["jobDefinition"] + # CommandJob and the schedule envelope both build the shared arm_ml_service hybrid (camelCase + # as_dict), so the embedded job_definition matches the standalone job's properties directly. + loaded_job_dict = inner_job._to_rest_object().as_dict()["properties"] assert rest_schedule_job_dict == loaded_job_dict # Test with local file + overwrites test_path = "./tests/test_configs/schedule/local_cron_command_job2.yml" schedule = load_schedule(test_path) - rest_schedule_job_dict = schedule._to_rest_object().as_dict()["properties"]["action"]["job_definition"] + rest_schedule_job_dict = schedule._to_rest_object().as_dict()["properties"]["action"]["jobDefinition"] # assert overwrite values - assert rest_schedule_job_dict["environment_variables"] == {"key": "val"} - assert rest_schedule_job_dict["resources"] == {"properties": {}, "shm_size": "1g"} + assert rest_schedule_job_dict["environmentVariables"] == {"key": "val"} + assert rest_schedule_job_dict["resources"] == {"properties": {}, "shmSize": "1g"} assert rest_schedule_job_dict["distribution"] == { - "distribution_type": "PyTorch", - "process_count_per_instance": 1, + "distributionType": "PyTorch", + "processCountPerInstance": 1, } - assert rest_schedule_job_dict["limits"] == {"job_limits_type": "Command", "timeout": "PT50M"} + assert rest_schedule_job_dict["limits"] == {"jobLimitsType": "Command", "timeout": "PT50M"} @pytest.mark.usefixtures( "enable_pipeline_private_preview_features", @@ -158,13 +155,15 @@ def test_schedule_entity_with_spark_job(self): inner_job_path = "./tests/test_configs/spark_job/spark_job_word_count_test.yml" inner_job = load_job(inner_job_path)._to_job() schedule = load_schedule(test_path) - rest_schedule_job_dict = schedule._to_rest_object().as_dict()["properties"]["action"]["job_definition"] - loaded_job_dict = inner_job._to_rest_object().as_dict()["properties"] + rest_schedule_job_dict = schedule._to_rest_object().as_dict()["properties"]["action"]["jobDefinition"] + # SparkJob builds a v2023_04 msrest envelope; the schedule embeds it as its camelCase wire dict + # (``.serialize()``), so compare against the standalone job serialized the same way. + loaded_job_dict = inner_job._to_rest_object().properties.serialize() assert rest_schedule_job_dict == loaded_job_dict # Test with local file + overwrites test_path = "./tests/test_configs/schedule/local_cron_spark_job2.yml" schedule = load_schedule(test_path) - rest_schedule_job_dict = schedule._to_rest_object().as_dict()["properties"]["action"]["job_definition"] + rest_schedule_job_dict = schedule._to_rest_object().as_dict()["properties"]["action"]["jobDefinition"] # assert overwrite values assert rest_schedule_job_dict["conf"] == { "spark.driver.cores": "2", @@ -173,7 +172,7 @@ def test_schedule_entity_with_spark_job(self): "spark.executor.memory": "2g", "spark.executor.instances": "2", } - assert "mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu22.04" in rest_schedule_job_dict["environment_id"] + assert "mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu22.04" in rest_schedule_job_dict["environmentId"] def test_invalid_date_string(self): pipeline_job = load_job( diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders.py index 3c548da6a732..2c60cec4bd77 100644 --- a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders.py +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders.py @@ -11,22 +11,40 @@ queue_settings/tags/properties/environment_variables) because the migration wraps each of those nested children, and a regression typically hides in exactly one child. """ -from azure.ai.ml import Input, Output, MpiDistribution +from azure.ai.ml import Input, Output, MpiDistribution, PyTorchDistribution, TensorFlowDistribution +from azure.ai.ml import command +from datetime import datetime from azure.ai.ml.constants._common import AssetTypes from azure.ai.ml.constants._job.finetuning import FineTuningTaskTypes -from azure.ai.ml.entities import CommandJob, Environment, JobSchedule, SparkJob +from azure.ai.ml.entities import ( + AmlTokenConfiguration, + CommandJob, + JobSchedule, + ManagedIdentityConfiguration, + PipelineJob, + PipelineJobSettings, + SparkJob, + UserIdentityConfiguration, +) from azure.ai.ml.entities._job.finetuning.custom_model_finetuning_job import CustomModelFineTuningJob from azure.ai.ml.entities._job.finetuning.azure_openai_finetuning_job import AzureOpenAIFineTuningJob from azure.ai.ml.entities._job.finetuning.azure_openai_hyperparameters import AzureOpenAIHyperparameters -from azure.ai.ml.entities._job.import_job import ImportJob, DatabaseImportSource +from azure.ai.ml.entities._job.import_job import ImportJob, DatabaseImportSource, FileImportSource from azure.ai.ml.entities._job.job_limits import CommandJobLimits, SweepJobLimits from azure.ai.ml.entities._job.job_resource_configuration import JobResourceConfiguration from azure.ai.ml.entities._job.queue_settings import QueueSettings from azure.ai.ml.entities._job.spark_resource_configuration import SparkResourceConfiguration from azure.ai.ml.entities._job.sweep.objective import Objective -from azure.ai.ml.entities._job.sweep.early_termination_policy import BanditPolicy -from azure.ai.ml.entities._job.sweep.search_space import Choice, Uniform -from azure.ai.ml.entities._schedule.trigger import CronTrigger +from azure.ai.ml.entities._job.sweep.early_termination_policy import ( + BanditPolicy, + MedianStoppingPolicy, + TruncationSelectionPolicy, +) +from azure.ai.ml.entities._job.sweep.search_space import Choice, LogUniform, QUniform, Randint, Uniform +from azure.ai.ml.entities._schedule.trigger import CronTrigger, RecurrencePattern, RecurrenceTrigger +from azure.ai.ml.entities._data_import.data_import import DataImport +from azure.ai.ml.entities._data_import.schedule import ImportDataSchedule +from azure.ai.ml.entities._inputs_outputs.external_data import Database, FileSystem from azure.ai.ml.sweep import SweepJob @@ -120,6 +138,158 @@ def build_sweep_job_full(): "command_job_full": build_command_job_full, } + +def build_command_job_minimal(): + """A CommandJob with only the required fields (guards optional-omission defaults). + + :return: A deterministic CommandJob entity. + :rtype: ~azure.ai.ml.entities.CommandJob + """ + return CommandJob( + name="smoke-command-minimal", + command="echo hello", + environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + compute="smoke-compute", + ) + + +def build_command_job_serverless(): + """A CommandJob with no named compute (serverless path omits computeId). + + :return: A deterministic CommandJob entity. + :rtype: ~azure.ai.ml.entities.CommandJob + """ + return CommandJob( + name="smoke-command-serverless", + command="echo serverless", + environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + resources=JobResourceConfiguration(instance_type="STANDARD_DS3_V2", instance_count=1), + ) + + +def build_command_job_aml_token(): + """A CommandJob whose identity is an AmlToken (guards the identity child wrap). + + :return: A deterministic CommandJob entity. + :rtype: ~azure.ai.ml.entities.CommandJob + """ + return CommandJob( + name="smoke-command-aml-token", + command="echo token", + environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + compute="smoke-compute", + identity=AmlTokenConfiguration(), + ) + + +def build_command_job_user_identity(): + """A CommandJob whose identity is a UserIdentity (guards the token-header isinstance gate). + + :return: A deterministic CommandJob entity. + :rtype: ~azure.ai.ml.entities.CommandJob + """ + return CommandJob( + name="smoke-command-user-identity", + command="echo user", + environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + compute="smoke-compute", + identity=UserIdentityConfiguration(), + ) + + +def build_command_job_managed_identity(): + """A CommandJob whose identity is a ManagedIdentity (guards the identity child wrap). + + :return: A deterministic CommandJob entity. + :rtype: ~azure.ai.ml.entities.CommandJob + """ + return CommandJob( + name="smoke-command-managed-identity", + command="echo managed", + environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + compute="smoke-compute", + identity=ManagedIdentityConfiguration(), + ) + + +def build_command_job_local_compute(): + """A CommandJob on local compute (guards the LOCAL_COMPUTE_PROPERTY resources injection). + + :return: A deterministic CommandJob entity. + :rtype: ~azure.ai.ml.entities.CommandJob + """ + return CommandJob( + name="smoke-command-local", + command="echo local", + environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + compute="local", + ) + + +def build_command_job_docker_args_list(): + """A CommandJob with list-form docker_args (routes to the 2025-01 resources model). + + :return: A deterministic CommandJob entity. + :rtype: ~azure.ai.ml.entities.CommandJob + """ + return CommandJob( + name="smoke-command-docker-args", + command="echo docker", + environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + compute="smoke-compute", + resources=JobResourceConfiguration( + instance_count=1, + docker_args=["--shm-size=1g", "--ipc=host"], + ), + ) + + +def build_command_job_pytorch(): + """A CommandJob with a PyTorch distribution (guards the distribution child wrap, non-Mpi). + + :return: A deterministic CommandJob entity. + :rtype: ~azure.ai.ml.entities.CommandJob + """ + return CommandJob( + name="smoke-command-pytorch", + command="python train.py", + environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + compute="smoke-compute", + distribution=PyTorchDistribution(process_count_per_instance=4), + resources=JobResourceConfiguration(instance_count=2), + ) + + +def build_command_job_tensorflow(): + """A CommandJob with a TensorFlow distribution (guards the distribution child wrap, non-Mpi). + + :return: A deterministic CommandJob entity. + :rtype: ~azure.ai.ml.entities.CommandJob + """ + return CommandJob( + name="smoke-command-tensorflow", + command="python train.py", + environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + compute="smoke-compute", + distribution=TensorFlowDistribution(worker_count=2, parameter_server_count=1), + resources=JobResourceConfiguration(instance_count=2), + ) + + +COMMAND_JOB_BUILDERS.update( + { + "command_job_minimal": build_command_job_minimal, + "command_job_serverless": build_command_job_serverless, + "command_job_aml_token": build_command_job_aml_token, + "command_job_user_identity": build_command_job_user_identity, + "command_job_managed_identity": build_command_job_managed_identity, + "command_job_local_compute": build_command_job_local_compute, + "command_job_docker_args_list": build_command_job_docker_args_list, + "command_job_pytorch": build_command_job_pytorch, + "command_job_tensorflow": build_command_job_tensorflow, + } +) + SWEEP_JOB_BUILDERS = { "sweep_job_full": build_sweep_job_full, } @@ -164,6 +334,96 @@ def build_spark_job_full(): } +def build_sweep_job_median_policy(): + """A SweepJob with a MedianStoppingPolicy and grid sampling (variation of termination + sampling). + + :return: A deterministic SweepJob entity. + :rtype: ~azure.ai.ml.sweep.SweepJob + """ + trial = CommandJob( + command="python train.py --lr ${{search_space.learning_rate}}", + environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + ) + return SweepJob( + name="smoke-sweep-median", + experiment_name="smoke-experiment", + compute="smoke-compute", + sampling_algorithm="grid", + search_space={"learning_rate": Choice(values=[0.01, 0.1])}, + objective=Objective(goal="minimize", primary_metric="loss"), + early_termination=MedianStoppingPolicy(evaluation_interval=1, delay_evaluation=5), + limits=SweepJobLimits(max_total_trials=4, max_concurrent_trials=2), + trial=trial, + ) + + +def build_sweep_job_truncation_policy(): + """A SweepJob with a TruncationSelectionPolicy and Bayesian sampling + varied search-space types. + + :return: A deterministic SweepJob entity. + :rtype: ~azure.ai.ml.sweep.SweepJob + """ + trial = CommandJob( + command="python train.py --lr ${{search_space.lr}} --units ${{search_space.units}}", + environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + ) + return SweepJob( + name="smoke-sweep-truncation", + experiment_name="smoke-experiment", + compute="smoke-compute", + sampling_algorithm="bayesian", + search_space={ + "lr": LogUniform(min_value=-6, max_value=-1), + "units": Randint(upper=128), + "dropout": QUniform(min_value=0.0, max_value=0.5, q=1), + }, + objective=Objective(goal="maximize", primary_metric="accuracy"), + early_termination=TruncationSelectionPolicy( + truncation_percentage=20, evaluation_interval=2, delay_evaluation=5 + ), + limits=SweepJobLimits(max_total_trials=8, max_concurrent_trials=4), + trial=trial, + ) + + +SWEEP_JOB_BUILDERS.update( + { + "sweep_job_median_policy": build_sweep_job_median_policy, + "sweep_job_truncation_policy": build_sweep_job_truncation_policy, + } +) + + +def build_spark_job_dynamic_allocation(): + """A SparkJob with dynamic allocation enabled and an AmlToken identity (variation of resources). + + :return: A deterministic SparkJob entity. + :rtype: ~azure.ai.ml.entities.SparkJob + """ + return SparkJob( + name="smoke-spark-dynamic", + experiment_name="smoke-experiment", + code="./src", + entry={"file": "main.py"}, + driver_cores=2, + driver_memory="4g", + executor_cores=2, + executor_memory="4g", + dynamic_allocation_enabled=True, + dynamic_allocation_min_executors=1, + dynamic_allocation_max_executors=4, + identity=AmlTokenConfiguration(), + resources=SparkResourceConfiguration(instance_type="Standard_E8S_V3", runtime_version="3.4.0"), + ) + + +SPARK_JOB_BUILDERS.update( + { + "spark_job_dynamic_allocation": build_spark_job_dynamic_allocation, + } +) + + def build_import_job_full(): """An ImportJob exercising a database source and an output. @@ -193,6 +453,35 @@ def build_import_job_full(): } +def build_import_job_file_source(): + """An ImportJob with a FileImportSource (variation of the import source type). + + :return: A deterministic ImportJob entity. + :rtype: ~azure.ai.ml.entities._job.import_job.ImportJob + """ + return ImportJob( + name="smoke-import-file", + display_name="smoke-import-file-display", + experiment_name="smoke-experiment", + compute="smoke-compute", + source=FileImportSource( + type="s3", + path="s3://my-bucket/my-folder/", + ), + output=Output( + type=AssetTypes.URI_FOLDER, + path="azureml://datastores/workspaceblobstore/paths/imported-files/", + ), + ) + + +IMPORT_JOB_BUILDERS.update( + { + "import_job_file_source": build_import_job_file_source, + } +) + + def build_schedule_full(): """A JobSchedule wrapping a command job with a CronTrigger. @@ -228,12 +517,184 @@ def build_schedule_full(): } +def build_schedule_recurrence_spark(): + """A JobSchedule wrapping a spark job with a RecurrenceTrigger (variation of trigger + embedded job). + + :return: A deterministic JobSchedule entity. + :rtype: ~azure.ai.ml.entities.JobSchedule + """ + job = SparkJob( + entry={"file": "main.py"}, + code="./src", + driver_cores=1, + driver_memory="2g", + executor_cores=2, + executor_memory="2g", + executor_instances=2, + compute="smoke-spark-compute", + ) + return JobSchedule( + name="smoke-schedule-recurrence", + display_name="smoke-schedule-recurrence-display", + trigger=RecurrenceTrigger( + frequency="week", + interval=1, + schedule=RecurrencePattern(hours=[10], minutes=[15], week_days=["monday", "wednesday"]), + start_time="2026-01-01T00:00:00", + time_zone="UTC", + ), + create_job=job, + ) + + +SCHEDULE_BUILDERS.update( + { + "schedule_recurrence_spark": build_schedule_recurrence_spark, + } +) + + +def build_schedule_cron_datetime(): + """A JobSchedule whose CronTrigger uses ``datetime`` start/end times (not strings). + + The YAML/schema layer parses trigger times into ``datetime`` objects; arm and msrest format those + differently on the wire (ISO ``...T...Z`` vs ``%Y-%m-%d %H:%M:%S``). String-only builders miss this, + so this case exercises the datetime path explicitly. + + :return: A deterministic JobSchedule entity. + :rtype: ~azure.ai.ml.entities.JobSchedule + """ + job = CommandJob( + command="echo scheduled", + environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + compute="smoke-compute", + ) + return JobSchedule( + name="smoke-schedule-cron-datetime", + display_name="smoke-schedule-cron-datetime-display", + trigger=CronTrigger( + expression="15 10 * * 1", + start_time=datetime(2026, 1, 1, 0, 0, 0), + end_time=datetime(2026, 12, 31, 0, 0, 0), + time_zone="UTC", + ), + create_job=job, + ) + + +SCHEDULE_BUILDERS.update( + { + "schedule_cron_datetime": build_schedule_cron_datetime, + } +) + + +def build_schedule_pipeline(): + """A JobSchedule wrapping a PipelineJob with a CronTrigger. + + PipelineJob routes to the v2024_01 msrest client, so its job_definition is a msrest model that must + be converted to a wire dict before embedding in the arm schedule envelope; this guards that branch + (which is distinct from the Command (arm) and Spark (v2023_04 msrest) branches). + + :return: A deterministic JobSchedule entity. + :rtype: ~azure.ai.ml.entities.JobSchedule + """ + node = command( + name="node1", + command="echo ${{inputs.x}}", + environment="azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + compute="smoke-compute", + inputs={"x": 1}, + ) + pipeline_job = PipelineJob( + jobs={"node1": node}, + settings=PipelineJobSettings(default_compute="smoke-compute"), + ) + return JobSchedule( + name="smoke-schedule-pipeline", + display_name="smoke-schedule-pipeline-display", + trigger=CronTrigger( + expression="15 10 * * 1", + start_time="2026-01-01T00:00:00", + time_zone="UTC", + ), + create_job=pipeline_job, + ) + + +SCHEDULE_BUILDERS.update( + { + "schedule_pipeline": build_schedule_pipeline, + } +) + + +def build_import_data_schedule_database(): + """An ImportDataSchedule wrapping a database DataImport with a CronTrigger. + + ImportDataAction/DataImport are absent from arm_ml_service, so the schedule envelope is arm but the + action is emitted as a JSON-direct wire dict. This case guards that mixed envelope (arm Schedule + + plain-dict action + arm trigger) which a wire-broken migration crashes on at serialize time. + + :return: A deterministic ImportDataSchedule entity. + :rtype: ~azure.ai.ml.entities._data_import.schedule.ImportDataSchedule + """ + import_data = DataImport( + name="smoke-azuresqldb-asset", + path="azureml://datastores/workspaceblobstore/paths/{name}", + source=Database(connection="azureml:smoke_connection", query="select * from region"), + ) + return ImportDataSchedule( + name="smoke-import-schedule-db", + display_name="smoke-import-schedule-db-display", + import_data=import_data, + trigger=CronTrigger( + expression="15 10 * * 1", + start_time="2026-01-01T00:00:00", + end_time="2026-12-31T00:00:00", + time_zone="UTC", + ), + ) + + +def build_import_data_schedule_file_system(): + """An ImportDataSchedule wrapping a file-system DataImport with a RecurrenceTrigger. + + :return: A deterministic ImportDataSchedule entity. + :rtype: ~azure.ai.ml.entities._data_import.schedule.ImportDataSchedule + """ + import_data = DataImport( + name="smoke-s3-asset", + path="azureml://datastores/workspaceblobstore/paths/{name}", + source=FileSystem(connection="azureml:smoke_s3_connection", path="test1/*"), + ) + return ImportDataSchedule( + name="smoke-import-schedule-fs", + display_name="smoke-import-schedule-fs-display", + import_data=import_data, + trigger=RecurrenceTrigger( + frequency="week", + interval=1, + schedule=RecurrencePattern(hours=[10], minutes=[15], week_days=["monday", "wednesday"]), + start_time="2026-01-01T00:00:00", + time_zone="UTC", + ), + ) + + +SCHEDULE_BUILDERS.update( + { + "import_data_schedule_database": build_import_data_schedule_database, + "import_data_schedule_file_system": build_import_data_schedule_file_system, + } +) + + def build_custom_finetuning_full(): """A CustomModelFineTuningJob exercising training/validation data, model, outputs and queue settings. - NOTE: this entity is KNOWN to have a pre-existing serialize break (custom finetuning outputs/ - queue_settings) that is present identically on main and on the migration branch. The test using - this builder is marked ``xfail`` and will auto-pass (xpass) once the break is fixed. + The custom-model path builds an arm_ml_service hybrid envelope, so its outputs/resources/ + queue_settings children are wrapped to hybrid; this case guards that whole tree. :return: A deterministic CustomModelFineTuningJob entity. :rtype: ~azure.ai.ml.entities._job.finetuning.custom_model_finetuning_job.CustomModelFineTuningJob @@ -257,8 +718,29 @@ def build_custom_finetuning_full(): ) +def build_custom_finetuning_minimal(): + """A CustomModelFineTuningJob with only required fields (no outputs/queue_settings/resources). + + Guards the arm-hybrid envelope when the optional children are absent (None-omission defaults). + + :return: A deterministic CustomModelFineTuningJob entity. + :rtype: ~azure.ai.ml.entities._job.finetuning.custom_model_finetuning_job.CustomModelFineTuningJob + """ + return CustomModelFineTuningJob( + name="smoke-custom-finetuning-minimal", + experiment_name="smoke-experiment", + task=FineTuningTaskTypes.TEXT_COMPLETION, + training_data=Input(type=AssetTypes.URI_FILE, path="https://foo/bar/train.csv"), + model=Input( + type=AssetTypes.MLFLOW_MODEL, + path="azureml://registries/azureml-meta/models/Llama-2-7b/versions/9", + ), + ) + + FINETUNING_BUILDERS = { "custom_finetuning_full": build_custom_finetuning_full, + "custom_finetuning_minimal": build_custom_finetuning_minimal, } @@ -292,3 +774,30 @@ def build_aoai_finetuning_full(): AOAI_FINETUNING_BUILDERS = { "aoai_finetuning_full": build_aoai_finetuning_full, } + + +def build_aoai_finetuning_minimal(): + """An AzureOpenAIFineTuningJob with only required fields (no hyperparameters/outputs). + + Guards the v2024_01 msrest tree when optional children are absent. + + :return: A deterministic AzureOpenAIFineTuningJob entity. + :rtype: ~azure.ai.ml.entities._job.finetuning.azure_openai_finetuning_job.AzureOpenAIFineTuningJob + """ + return AzureOpenAIFineTuningJob( + name="smoke-aoai-finetuning-minimal", + experiment_name="smoke-experiment", + task=FineTuningTaskTypes.TEXT_COMPLETION, + training_data=Input(type=AssetTypes.URI_FILE, path="https://foo/bar/train.jsonl"), + model=Input( + type=AssetTypes.CUSTOM_MODEL, + path="azureml://registries/azure-openai/models/gpt-4/versions/1", + ), + ) + + +AOAI_FINETUNING_BUILDERS.update( + { + "aoai_finetuning_minimal": build_aoai_finetuning_minimal, + } +) diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_asset.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_asset.py new file mode 100644 index 000000000000..a3ba1c31f049 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_asset.py @@ -0,0 +1,126 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Deterministic builders for asset entities (Model, Environment, Data, Code). + +Uses remote ``azureml://`` / image references so ``_to_rest_object`` does not need local file upload. +""" +from azure.ai.ml.constants._common import AssetTypes +from azure.ai.ml.entities import Data, Environment, Model +from azure.ai.ml.entities._assets._artifacts.code import Code +from azure.ai.ml.entities._assets.environment import BuildContext + +_REMOTE = "azureml://datastores/workspaceblobstore/paths/smoke/" + + +def build_model_full(): + """Model with flavors, stage, tags and a remote path.""" + return Model( + name="smoke-model", + version="1", + type=AssetTypes.CUSTOM_MODEL, + path=_REMOTE + "model/", + description="smoke model", + tags={"tag1": "value1"}, + properties={"prop1": "value1"}, + stage="Production", + flavors={"python_function": {"loader_module": "smoke.loader"}}, + ) + + +def build_model_mlflow(): + """MLflow model variation.""" + return Model( + name="smoke-model-mlflow", + version="2", + type=AssetTypes.MLFLOW_MODEL, + path=_REMOTE + "mlflow-model/", + ) + + +def build_environment_image(): + """Environment from a docker image + conda spec.""" + return Environment( + name="smoke-env-image", + version="1", + image="mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu20.04:latest", + description="smoke env", + tags={"tag1": "value1"}, + conda_file={ + "name": "smoke", + "dependencies": ["python=3.10", {"pip": ["azure-ai-ml"]}], + }, + ) + + +def build_environment_build_context(): + """Environment from a build context (Dockerfile).""" + return Environment( + name="smoke-env-build", + version="1", + build=BuildContext(path=_REMOTE + "context/", dockerfile_path="Dockerfile"), + ) + + +def build_data_uri_folder(): + """Data asset of type uri_folder.""" + return Data( + name="smoke-data-folder", + version="1", + path=_REMOTE + "data/", + type=AssetTypes.URI_FOLDER, + description="smoke data", + tags={"tag1": "value1"}, + ) + + +def build_data_uri_file(): + """Data asset of type uri_file.""" + return Data( + name="smoke-data-file", + version="1", + path=_REMOTE + "data/file.csv", + type=AssetTypes.URI_FILE, + ) + + +def build_data_mltable(): + """Data asset of type mltable.""" + return Data( + name="smoke-data-mltable", + version="1", + path=_REMOTE + "mltable/", + type=AssetTypes.MLTABLE, + ) + + +def build_code_full(): + """Code asset with a remote path.""" + return Code( + name="smoke-code", + version="1", + path=_REMOTE + "code/", + description="smoke code", + tags={"tag1": "value1"}, + ) + + +MODEL_BUILDERS = { + "model_full": build_model_full, + "model_mlflow": build_model_mlflow, +} + +ENVIRONMENT_BUILDERS = { + "environment_image": build_environment_image, + "environment_build_context": build_environment_build_context, +} + +DATA_BUILDERS = { + "data_uri_folder": build_data_uri_folder, + "data_uri_file": build_data_uri_file, + "data_mltable": build_data_mltable, +} + +CODE_BUILDERS = { + "code_full": build_code_full, +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_automl.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_automl.py new file mode 100644 index 000000000000..7472718a4c1d --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_automl.py @@ -0,0 +1,108 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Deterministic builders for AutoML job entities (tabular + image + nlp).""" +from azure.ai.ml import Input, automl +from azure.ai.ml.constants._common import AssetTypes + +_TRAIN = Input(type=AssetTypes.MLTABLE, path="azureml://datastores/workspaceblobstore/paths/smoke/train/") +_VALID = Input(type=AssetTypes.MLTABLE, path="azureml://datastores/workspaceblobstore/paths/smoke/valid/") + + +def build_automl_classification(): + """AutoML tabular classification job.""" + job = automl.classification( + name="smoke-automl-classification", + compute="smoke-compute", + experiment_name="smoke-experiment", + training_data=_TRAIN, + validation_data=_VALID, + target_column_name="target", + primary_metric="accuracy", + ) + job.set_limits(timeout_minutes=60, max_trials=10, max_concurrent_trials=2) + return job + + +def build_automl_regression(): + """AutoML tabular regression job.""" + job = automl.regression( + name="smoke-automl-regression", + compute="smoke-compute", + experiment_name="smoke-experiment", + training_data=_TRAIN, + validation_data=_VALID, + target_column_name="target", + primary_metric="r2_score", + ) + job.set_limits(timeout_minutes=60, max_trials=10, max_concurrent_trials=2) + return job + + +def build_automl_forecasting(): + """AutoML tabular forecasting job.""" + job = automl.forecasting( + name="smoke-automl-forecasting", + compute="smoke-compute", + experiment_name="smoke-experiment", + training_data=_TRAIN, + validation_data=_VALID, + target_column_name="target", + primary_metric="normalized_root_mean_squared_error", + ) + job.set_limits(timeout_minutes=60, max_trials=10, max_concurrent_trials=2) + job.set_forecast_settings(time_column_name="timestamp", forecast_horizon=12) + return job + + +def build_automl_text_classification(): + """AutoML NLP text classification job.""" + job = automl.text_classification( + name="smoke-automl-text-classification", + compute="smoke-compute", + experiment_name="smoke-experiment", + training_data=_TRAIN, + validation_data=_VALID, + target_column_name="target", + primary_metric="accuracy", + ) + job.set_limits(timeout_minutes=60, max_trials=2, max_concurrent_trials=1) + return job + + +def build_automl_text_ner(): + """AutoML NLP text NER job.""" + job = automl.text_ner( + name="smoke-automl-text-ner", + compute="smoke-compute", + experiment_name="smoke-experiment", + training_data=_TRAIN, + validation_data=_VALID, + ) + job.set_limits(timeout_minutes=60, max_trials=2, max_concurrent_trials=1) + return job + + +def build_automl_image_classification(): + """AutoML image classification job.""" + job = automl.image_classification( + name="smoke-automl-image-classification", + compute="smoke-compute", + experiment_name="smoke-experiment", + training_data=_TRAIN, + validation_data=_VALID, + target_column_name="label", + primary_metric="accuracy", + ) + job.set_limits(timeout_minutes=60, max_trials=2, max_concurrent_trials=1) + return job + + +AUTOML_BUILDERS = { + "automl_classification": build_automl_classification, + "automl_regression": build_automl_regression, + "automl_forecasting": build_automl_forecasting, + "automl_text_classification": build_automl_text_classification, + "automl_text_ner": build_automl_text_ner, + "automl_image_classification": build_automl_image_classification, +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_component.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_component.py new file mode 100644 index 000000000000..ff79208f22d2 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_component.py @@ -0,0 +1,62 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Deterministic builders for component entities (Command, Spark).""" +from azure.ai.ml import Input, Output +from azure.ai.ml.entities import CommandComponent, SparkComponent + + +def build_command_component(): + """CommandComponent with typed inputs/outputs, command and environment.""" + return CommandComponent( + name="smoke_command_component", + version="1", + display_name="smoke command component", + description="smoke command component", + tags={"tag1": "value1"}, + command="echo ${{inputs.learning_rate}} ${{inputs.data}} && echo ${{outputs.model}}", + environment="azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + inputs={ + "learning_rate": Input(type="number", default=0.01), + "epochs": Input(type="integer", default=10), + "data": Input(type="uri_folder"), + "flag": Input(type="boolean", default=True), + }, + outputs={ + "model": Output(type="uri_folder"), + }, + ) + + +def build_spark_component(): + """SparkComponent with entry, conf and typed inputs/outputs.""" + return SparkComponent( + name="smoke_spark_component", + version="1", + display_name="smoke spark component", + description="smoke spark component", + tags={"tag1": "value1"}, + code="./src", + entry={"file": "main.py"}, + driver_cores=1, + driver_memory="2g", + executor_cores=2, + executor_memory="2g", + executor_instances=2, + inputs={ + "data": Input(type="uri_file", mode="direct"), + }, + outputs={ + "output": Output(type="uri_folder", mode="direct"), + }, + args="--input ${{inputs.data}} --output ${{outputs.output}}", + ) + + +COMMAND_COMPONENT_BUILDERS = { + "command_component": build_command_component, +} + +SPARK_COMPONENT_BUILDERS = { + "spark_component": build_spark_component, +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_compute.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_compute.py new file mode 100644 index 000000000000..3bfca583158b --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_compute.py @@ -0,0 +1,130 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Deterministic builders for compute entities (smoke serialization suite). + +Compute types span the still-to-migrate API versions (v2022-10, v2022-12, v2023-08), so their +request-wire serialization is exactly what the upcoming migrations must preserve. Each builder is +fully deterministic (fixed names, no random/timestamp) so the wire is byte-stable across runs. +""" +from azure.ai.ml.entities import ( + AmlCompute, + ComputeInstance, + IdentityConfiguration, + KubernetesCompute, + SynapseSparkCompute, + VirtualMachineCompute, +) +from azure.ai.ml.entities._compute.aml_compute import AmlComputeSshSettings +from azure.ai.ml.entities._compute.compute import NetworkSettings +from azure.ai.ml.entities._compute.compute_instance import ComputeInstanceSshSettings +from azure.ai.ml.entities._compute.synapsespark_compute import AutoPauseSettings, AutoScaleSettings +from azure.ai.ml.entities._compute._setup_scripts import ScriptReference, SetupScripts +from azure.ai.ml.entities._compute.virtual_machine_compute import VirtualMachineSshSettings + +_FAKE_VM_ID = ( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/smoke-rg" + "/providers/Microsoft.Compute/virtualMachines/smoke-vm" +) + + +def build_aml_compute_full(): + """AmlCompute with ssh, network, identity, tier and scale settings.""" + return AmlCompute( + name="smoke-aml-compute", + description="smoke aml compute", + size="STANDARD_DS3_V2", + tags={"tag1": "value1"}, + min_instances=0, + max_instances=4, + idle_time_before_scale_down=120, + tier="dedicated", + ssh_public_access_enabled=True, + ssh_settings=AmlComputeSshSettings(admin_username="azureuser", ssh_key_value="ssh-rsa AAAAB3Nz smoke"), + network_settings=NetworkSettings(vnet_name="smoke-vnet", subnet="smoke-subnet"), + identity=IdentityConfiguration(type="system_assigned"), + enable_node_public_ip=True, + ) + + +def build_aml_compute_minimal(): + """AmlCompute with only required fields.""" + return AmlCompute(name="smoke-aml-minimal", size="STANDARD_DS3_V2") + + +def build_compute_instance_full(): + """ComputeInstance with ssh, setup scripts and identity.""" + return ComputeInstance( + name="smoke-compute-instance", + description="smoke compute instance", + size="STANDARD_DS3_V2", + tags={"tag1": "value1"}, + ssh_public_access_enabled=True, + ssh_settings=ComputeInstanceSshSettings(ssh_key_value="ssh-rsa AAAAB3Nz smoke"), + setup_scripts=SetupScripts( + startup_script=ScriptReference(path="setup.sh", command="bash setup.sh", timeout_minutes=10) + ), + identity=IdentityConfiguration(type="system_assigned"), + idle_time_before_shutdown_minutes=30, + enable_node_public_ip=True, + enable_sso=True, + enable_root_access=True, + ) + + +def build_compute_instance_minimal(): + """ComputeInstance with only required fields.""" + return ComputeInstance(name="smoke-ci-minimal", size="STANDARD_DS3_V2") + + +def build_kubernetes_compute_full(): + """KubernetesCompute with namespace, properties and identity.""" + return KubernetesCompute( + name="smoke-k8s-compute", + description="smoke kubernetes compute", + namespace="smoke-namespace", + properties={"defaultInstanceType": "defaultInstanceType", "vcName": "smoke-vc"}, + identity=IdentityConfiguration(type="system_assigned"), + ) + + +def build_synapse_spark_compute_full(): + """SynapseSparkCompute with node config, scale and auto-pause settings.""" + return SynapseSparkCompute( + name="smoke-synapse-spark", + description="smoke synapse spark compute", + tags={"tag1": "value1"}, + node_count=3, + node_family="MemoryOptimized", + node_size="Medium", + spark_version="3.4", + identity=IdentityConfiguration(type="system_assigned"), + scale_settings=AutoScaleSettings(min_node_count=1, max_node_count=5, enabled=True), + auto_pause_settings=AutoPauseSettings(delay_in_minutes=15, enabled=True), + ) + + +def build_virtual_machine_compute_full(): + """VirtualMachineCompute with resource id and ssh settings.""" + return VirtualMachineCompute( + name="smoke-vm-compute", + description="smoke vm compute", + resource_id=_FAKE_VM_ID, + tags={"tag1": "value1"}, + ssh_settings=VirtualMachineSshSettings( + admin_username="azureuser", + admin_password="smoke-password", + ssh_port=22, + ), + ) + + +COMPUTE_BUILDERS = { + "aml_compute_full": build_aml_compute_full, + "aml_compute_minimal": build_aml_compute_minimal, + "compute_instance_full": build_compute_instance_full, + "compute_instance_minimal": build_compute_instance_minimal, + "kubernetes_compute_full": build_kubernetes_compute_full, + "synapse_spark_compute_full": build_synapse_spark_compute_full, + "virtual_machine_compute_full": build_virtual_machine_compute_full, +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_datastore.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_datastore.py new file mode 100644 index 000000000000..09337dcd3e81 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_datastore.py @@ -0,0 +1,108 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Deterministic builders for datastore entities (smoke serialization suite). + +Datastores are part of the control-plane surface the upcoming migrations touch. Each builder is fully +deterministic so the request wire is byte-stable across runs. +""" +from azure.ai.ml.entities import ( + AccountKeyConfiguration, + AzureBlobDatastore, + AzureDataLakeGen1Datastore, + AzureDataLakeGen2Datastore, + AzureFileDatastore, + SasTokenConfiguration, + ServicePrincipalConfiguration, +) +from azure.ai.ml.entities._datastore.one_lake import LakeHouseArtifact, OneLakeDatastore + + +def build_blob_datastore_account_key(): + """AzureBlobDatastore with an account-key credential.""" + return AzureBlobDatastore( + name="smoke-blob-ds", + description="smoke blob datastore", + account_name="smokeaccount", + container_name="smoke-container", + tags={"tag1": "value1"}, + credentials=AccountKeyConfiguration(account_key="smoke-account-key"), + ) + + +def build_blob_datastore_sas(): + """AzureBlobDatastore with a SAS-token credential and explicit endpoint/protocol.""" + return AzureBlobDatastore( + name="smoke-blob-ds-sas", + account_name="smokeaccount", + container_name="smoke-container", + endpoint="core.windows.net", + protocol="https", + credentials=SasTokenConfiguration(sas_token="?sv=smoke-sas-token"), + ) + + +def build_file_datastore(): + """AzureFileDatastore with an account-key credential.""" + return AzureFileDatastore( + name="smoke-file-ds", + account_name="smokeaccount", + file_share_name="smoke-share", + tags={"tag1": "value1"}, + credentials=AccountKeyConfiguration(account_key="smoke-account-key"), + ) + + +def build_adls_gen1_datastore(): + """AzureDataLakeGen1Datastore with a service-principal credential.""" + return AzureDataLakeGen1Datastore( + name="smoke-gen1-ds", + store_name="smoke-store", + tags={"tag1": "value1"}, + credentials=ServicePrincipalConfiguration( + tenant_id="00000000-0000-0000-0000-000000000000", + client_id="11111111-1111-1111-1111-111111111111", + client_secret="smoke-secret", + ), + ) + + +def build_adls_gen2_datastore(): + """AzureDataLakeGen2Datastore with a service-principal credential.""" + return AzureDataLakeGen2Datastore( + name="smoke-gen2-ds", + account_name="smokeaccount", + filesystem="smoke-filesystem", + endpoint="core.windows.net", + protocol="https", + credentials=ServicePrincipalConfiguration( + tenant_id="00000000-0000-0000-0000-000000000000", + client_id="11111111-1111-1111-1111-111111111111", + client_secret="smoke-secret", + ), + ) + + +def build_one_lake_datastore(): + """OneLakeDatastore with a LakeHouse artifact and a service-principal credential.""" + return OneLakeDatastore( + name="smoke-onelake-ds", + one_lake_workspace_name="smoke-onelake-workspace", + endpoint="onelake.dfs.fabric.microsoft.com", + artifact=LakeHouseArtifact(name="smoke-lakehouse"), + credentials=ServicePrincipalConfiguration( + tenant_id="00000000-0000-0000-0000-000000000000", + client_id="11111111-1111-1111-1111-111111111111", + client_secret="smoke-secret", + ), + ) + + +DATASTORE_BUILDERS = { + "blob_datastore_account_key": build_blob_datastore_account_key, + "blob_datastore_sas": build_blob_datastore_sas, + "file_datastore": build_file_datastore, + "adls_gen1_datastore": build_adls_gen1_datastore, + "adls_gen2_datastore": build_adls_gen2_datastore, + "one_lake_datastore": build_one_lake_datastore, +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_endpoint.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_endpoint.py new file mode 100644 index 000000000000..aa2a84a9d380 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_endpoint.py @@ -0,0 +1,79 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Deterministic builders for online/batch endpoint entities. + +Endpoints serialize via a location-bound method (``_to_rest_online_endpoint(location)`` / +``_to_rest_batch_endpoint(location)``) that returns an ``arm_ml_service`` hybrid model, so each builder +returns a small ``_RestAdapter`` exposing the suite's uniform no-arg ``_to_rest_object()`` contract. + +DEPLOYMENTS are intentionally NOT covered here. ``OnlineDeployment._to_rest_object(location)`` returns +a per-version msrest envelope (v2023_04) while its nested children (e.g. ``ProbeSettings``) already +serialize to ``arm_ml_service`` hybrid models — a mixed tree that the operations layer resolves at +send time, not a clean offline ``_to_rest_object`` -> wire path. (#47554 did not touch +``deployment_settings.py``; this is pre-existing.) Cover deployments when the online/batch deployment +migration lands and the envelope + children are unified on one generator. +""" +from azure.ai.ml.entities import ( + BatchEndpoint, + IdentityConfiguration, + ManagedOnlineEndpoint, +) + +_LOCATION = "westus" + + +class _RestAdapter: + """Expose a location-bound rest method as the suite's no-arg ``_to_rest_object()`` contract. + + :param entity: The endpoint/deployment entity. + :param method: Name of the location-taking rest method on the entity. + :param location: The location string to pass. + """ + + def __init__(self, entity, method, location=_LOCATION): + self._entity = entity + self._method = method + self._location = location + + def _to_rest_object(self): + """Call the bound rest method with the fixed location. + + :return: The rest object for the bound entity. + :rtype: Any + """ + return getattr(self._entity, self._method)(self._location) + + +def build_managed_online_endpoint(): + """ManagedOnlineEndpoint with traffic, identity and tags.""" + endpoint = ManagedOnlineEndpoint( + name="smoke-online-endpoint", + description="smoke online endpoint", + auth_mode="key", + tags={"tag1": "value1"}, + traffic={"blue": 100}, + identity=IdentityConfiguration(type="system_assigned"), + ) + return _RestAdapter(endpoint, "_to_rest_online_endpoint") + + +def build_batch_endpoint(): + """BatchEndpoint with defaults and tags.""" + endpoint = BatchEndpoint( + name="smoke-batch-endpoint", + description="smoke batch endpoint", + auth_mode="aad_token", + tags={"tag1": "value1"}, + defaults={"deployment_name": "smoke-batch-deployment"}, + ) + return _RestAdapter(endpoint, "_to_rest_batch_endpoint") + + +ONLINE_ENDPOINT_BUILDERS = { + "managed_online_endpoint": build_managed_online_endpoint, +} + +BATCH_ENDPOINT_BUILDERS = { + "batch_endpoint": build_batch_endpoint, +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_featurestore.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_featurestore.py new file mode 100644 index 000000000000..36aa770650bc --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_featurestore.py @@ -0,0 +1,66 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Deterministic builders for feature-store + data-import entities.""" +from azure.ai.ml.data_transfer import Database +from azure.ai.ml.entities import DataImport, FeatureSet, FeatureStoreEntity +from azure.ai.ml.entities._feature_set.feature_set_specification import FeatureSetSpecification +from azure.ai.ml.entities._feature_store_entity.data_column import DataColumn +from azure.ai.ml.entities._feature_store_entity.data_column_type import DataColumnType + +_ENTITY_ID = ( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/smoke-rg/providers" + "/Microsoft.MachineLearningServices/workspaces/smoke-ws/featurestoreEntities/smoke-entity/versions/1" +) + + +def build_feature_set(): + """FeatureSet with a spec path, entity reference and stage.""" + return FeatureSet( + name="smoke-feature-set", + version="1", + description="smoke feature set", + tags={"tag1": "value1"}, + entities=[_ENTITY_ID], + stage="Development", + specification=FeatureSetSpecification(path="azureml://datastores/workspaceblobstore/paths/smoke/spec/"), + ) + + +def build_feature_store_entity(): + """FeatureStoreEntity with index columns.""" + return FeatureStoreEntity( + name="smoke-feature-store-entity", + version="1", + description="smoke feature store entity", + tags={"tag1": "value1"}, + stage="Development", + index_columns=[ + DataColumn(name="customer_id", type=DataColumnType.STRING), + DataColumn(name="region_id", type=DataColumnType.INTEGER), + ], + ) + + +def build_data_import_database(): + """DataImport from a database source.""" + return DataImport( + name="smoke-data-import", + description="smoke data import", + tags={"tag1": "value1"}, + path="azureml://datastores/workspaceblobstore/paths/smoke/imported/", + source=Database(query="SELECT * FROM my_table", connection="azureml:my_connection"), + ) + + +FEATURE_SET_BUILDERS = { + "feature_set": build_feature_set, +} + +FEATURE_STORE_ENTITY_BUILDERS = { + "feature_store_entity": build_feature_store_entity, +} + +DATA_IMPORT_BUILDERS = { + "data_import_database": build_data_import_database, +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_monitoring.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_monitoring.py new file mode 100644 index 000000000000..b7d1adbff2b4 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_monitoring.py @@ -0,0 +1,99 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Deterministic builders for monitoring (MonitorSchedule) entities. + +Each builder loads one of the committed monitoring YAML configs via ``load_schedule`` and returns +the resulting ``MonitorSchedule`` entity. The smoke harness then calls ``_to_rest_object()`` and +asserts the serialized wire body is byte-identical to the captured baseline. These configs exercise +every monitor signal type (data drift, data quality, prediction drift, feature attribution, +model performance, custom, generation safety/quality, generation token statistics, out-of-the-box). +""" +import os + +from azure.ai.ml.entities._load_functions import load_schedule + +# Monitoring YAML configs live under tests/test_configs/monitoring/yaml_configs. Resolve relative to +# this file (tests/smoke_serialization/) so the suite is cwd-independent. +_CONFIG_DIR = os.path.normpath( + os.path.join(os.path.dirname(__file__), "..", "test_configs", "monitoring", "yaml_configs") +) + + +def _load(config_name): + """Load a MonitorSchedule entity from a committed monitoring YAML config. + + :param config_name: The YAML file name (e.g. ``"data_drift.yaml"``). + :return: The loaded MonitorSchedule entity. + :rtype: ~azure.ai.ml.entities.MonitorSchedule + """ + return load_schedule(os.path.join(_CONFIG_DIR, config_name)) + + +def build_monitor_data_drift(): + """MonitorSchedule with a data-drift signal and recurrence trigger.""" + return _load("data_drift.yaml") + + +def build_monitor_data_quality(): + """MonitorSchedule with a data-quality signal.""" + return _load("data_quality.yaml") + + +def build_monitor_prediction_drift(): + """MonitorSchedule with a prediction-drift signal.""" + return _load("prediction_drift.yaml") + + +def build_monitor_feature_attribution_drift(): + """MonitorSchedule with a feature-attribution-drift signal.""" + return _load("feature_attribution_drift.yaml") + + +def build_monitor_model_performance(): + """MonitorSchedule with a model-performance signal.""" + return _load("model_performance.yaml") + + +def build_monitor_custom(): + """MonitorSchedule with a custom monitoring signal.""" + return _load("custom.yaml") + + +def build_monitor_generation_safety(): + """MonitorSchedule with a generation-safety-quality signal.""" + return _load("generation_safety.yaml") + + +def build_monitor_generation_token_statistics(): + """MonitorSchedule with a generation-token-statistics signal.""" + return _load("generation_token_statistics.yaml") + + +def build_monitor_out_of_the_box(): + """MonitorSchedule with an out-of-the-box monitor definition. + + EXCLUDED from the suite: a monitor with no explicit signals hits a pre-existing + ``UnboundLocalError: local variable '_signals' referenced before assignment`` in + ``MonitorDefinition._to_rest_object`` (reproduces on pre-migration code, unrelated to the + client migration). Cover it once the no-signals path is fixed. + """ + return _load("out_of_the_box.yaml") + + +def build_monitor_no_target_baseline_data(): + """MonitorSchedule without target/baseline data.""" + return _load("no_target_baseline_data.yaml") + + +MONITORING_BUILDERS = { + "monitor_data_drift": build_monitor_data_drift, + "monitor_data_quality": build_monitor_data_quality, + "monitor_prediction_drift": build_monitor_prediction_drift, + "monitor_feature_attribution_drift": build_monitor_feature_attribution_drift, + "monitor_model_performance": build_monitor_model_performance, + "monitor_custom": build_monitor_custom, + "monitor_generation_safety": build_monitor_generation_safety, + "monitor_generation_token_statistics": build_monitor_generation_token_statistics, + "monitor_no_target_baseline_data": build_monitor_no_target_baseline_data, +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_workspace.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_workspace.py new file mode 100644 index 000000000000..a4c2a175f0b1 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_builders_workspace.py @@ -0,0 +1,59 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Deterministic builders for workspace / registry entities. + +WorkspaceConnection is intentionally NOT covered: its ``_to_rest_object`` embeds a credential child +(e.g. ``WorkspaceConnectionPersonalAccessToken``) that already serializes to an ``arm_ml_service`` +hybrid model inside a v2022_10 msrest envelope — a mixed tree resolved by the operations layer at send +time, not a clean offline path (same situation as online/batch deployments). Cover connections when +their migration unifies envelope + children on one generator. +""" +from azure.ai.ml.entities import ( + IdentityConfiguration, + Registry, + Workspace, +) +from azure.ai.ml.entities._registry.registry_support_classes import RegistryRegionDetails + + +def build_workspace_full(): + """Workspace with location, identity and tags.""" + return Workspace( + name="smoke-workspace", + description="smoke workspace", + location="westus", + display_name="Smoke Workspace", + tags={"tag1": "value1"}, + hbi_workspace=False, + public_network_access="Enabled", + identity=IdentityConfiguration(type="system_assigned"), + enable_data_isolation=False, + ) + + +def build_workspace_minimal(): + """Workspace with only required fields.""" + return Workspace(name="smoke-workspace-minimal", location="westus") + + +def build_registry_full(): + """Registry with a single replication region.""" + return Registry( + name="smoke-registry", + location="westus", + tags={"tag1": "value1"}, + public_network_access="Enabled", + replication_locations=[RegistryRegionDetails(location="westus")], + identity=IdentityConfiguration(type="system_assigned"), + ) + + +WORKSPACE_BUILDERS = { + "workspace_full": build_workspace_full, + "workspace_minimal": build_workspace_minimal, +} + +REGISTRY_BUILDERS = { + "registry_full": build_registry_full, +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/_registry.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_registry.py new file mode 100644 index 000000000000..d07a4fb90289 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/_registry.py @@ -0,0 +1,36 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Auto-discovery of all builder registries in the smoke suite. + +Every ``_builders*.py`` module in this folder may expose one or more module-level dicts whose name +ends in ``_BUILDERS`` (mapping ``case_name -> zero-arg builder``). ``all_builders()`` collects them +all, so the generator and any aggregate test never need editing when a new family module is added. +""" +import glob +import importlib +import os + +_THIS_DIR = os.path.dirname(__file__) + + +def all_builders(): + """Return a merged ``{case_name: builder}`` dict across every ``_builders*.py`` module. + + :return: Merged mapping of case name to zero-arg builder callable. + :rtype: dict + :raises RuntimeError: if two modules define the same case name (case names must be globally unique). + """ + merged = {} + for path in sorted(glob.glob(os.path.join(_THIS_DIR, "_builders*.py"))): + mod_name = os.path.splitext(os.path.basename(path))[0] + module = importlib.import_module(mod_name) + for attr in dir(module): + if attr.endswith("_BUILDERS"): + registry = getattr(module, attr) + if isinstance(registry, dict): + for case_name, builder in registry.items(): + if case_name in merged: + raise RuntimeError("Duplicate smoke case name '{0}' (in {1})".format(case_name, mod_name)) + merged[case_name] = builder + return merged diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/adls_gen1_datastore.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/adls_gen1_datastore.json new file mode 100644 index 000000000000..0826d304b60c --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/adls_gen1_datastore.json @@ -0,0 +1,19 @@ +{ + "properties": { + "credentials": { + "authorityUrl": "https://login.microsoftonline.com", + "clientId": "11111111-1111-1111-1111-111111111111", + "credentialsType": "ServicePrincipal", + "secrets": { + "clientSecret": "smoke-secret", + "secretsType": "ServicePrincipal" + }, + "tenantId": "00000000-0000-0000-0000-000000000000" + }, + "datastoreType": "AzureDataLakeGen1", + "storeName": "smoke-store", + "tags": { + "tag1": "value1" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/adls_gen2_datastore.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/adls_gen2_datastore.json new file mode 100644 index 000000000000..16449150fc66 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/adls_gen2_datastore.json @@ -0,0 +1,20 @@ +{ + "properties": { + "accountName": "smokeaccount", + "credentials": { + "authorityUrl": "https://login.microsoftonline.com", + "clientId": "11111111-1111-1111-1111-111111111111", + "credentialsType": "ServicePrincipal", + "secrets": { + "clientSecret": "smoke-secret", + "secretsType": "ServicePrincipal" + }, + "tenantId": "00000000-0000-0000-0000-000000000000" + }, + "datastoreType": "AzureDataLakeGen2", + "endpoint": "core.windows.net", + "filesystem": "smoke-filesystem", + "protocol": "https", + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/aml_compute_full.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/aml_compute_full.json new file mode 100644 index 000000000000..f15347439ea2 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/aml_compute_full.json @@ -0,0 +1,30 @@ +{ + "identity": { + "type": "SystemAssigned" + }, + "properties": { + "computeType": "AmlCompute", + "description": "smoke aml compute", + "disableLocalAuth": false, + "properties": { + "enableNodePublicIp": true, + "osType": "Linux", + "remoteLoginPortPublicAccess": "Enabled", + "scaleSettings": { + "maxNodeCount": 4, + "minNodeCount": 0, + "nodeIdleTimeBeforeScaleDown": "PT2M" + }, + "subnet": {}, + "userAccountCredentials": { + "adminUserName": "azureuser", + "adminUserSshPublicKey": "ssh-rsa AAAAB3Nz smoke" + }, + "vmPriority": "Dedicated", + "vmSize": "STANDARD_DS3_V2" + } + }, + "tags": { + "tag1": "value1" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/aml_compute_minimal.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/aml_compute_minimal.json new file mode 100644 index 000000000000..d085d0e9081b --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/aml_compute_minimal.json @@ -0,0 +1,17 @@ +{ + "properties": { + "computeType": "AmlCompute", + "disableLocalAuth": true, + "properties": { + "enableNodePublicIp": true, + "osType": "Linux", + "remoteLoginPortPublicAccess": "NotSpecified", + "scaleSettings": { + "maxNodeCount": 4, + "minNodeCount": 0, + "nodeIdleTimeBeforeScaleDown": "PT2M" + }, + "vmSize": "STANDARD_DS3_V2" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/aoai_finetuning_minimal.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/aoai_finetuning_minimal.json new file mode 100644 index 000000000000..500b9facc93b --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/aoai_finetuning_minimal.json @@ -0,0 +1,22 @@ +{ + "properties": { + "experimentName": "smoke-experiment", + "fineTuningDetails": { + "model": { + "jobInputType": "mlflow_model", + "uri": "azureml://registries/azure-openai/models/gpt-4/versions/1" + }, + "modelProvider": "AzureOpenAI", + "taskType": "textCompletion", + "trainingData": { + "jobInputType": "uri_file", + "uri": "https://foo/bar/train.jsonl" + } + }, + "isArchived": false, + "jobType": "FineTuning", + "outputs": {}, + "properties": {}, + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/automl_classification.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/automl_classification.json new file mode 100644 index 000000000000..c2531093cabe --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/automl_classification.json @@ -0,0 +1,33 @@ +{ + "properties": { + "computeId": "smoke-compute", + "experimentName": "smoke-experiment", + "isArchived": false, + "jobType": "AutoML", + "outputs": {}, + "properties": {}, + "tags": {}, + "taskDetails": { + "limitSettings": { + "maxConcurrentTrials": 2, + "maxTrials": 10, + "sweepConcurrentTrials": 0, + "sweepTrials": 0, + "timeout": "PT1H" + }, + "logVerbosity": "Info", + "primaryMetric": "Accuracy", + "targetColumnName": "target", + "taskType": "Classification", + "trainingData": { + "jobInputType": "mltable", + "uri": "azureml://datastores/workspaceblobstore/paths/smoke/train/" + }, + "trainingSettings": {}, + "validationData": { + "jobInputType": "mltable", + "uri": "azureml://datastores/workspaceblobstore/paths/smoke/valid/" + } + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/automl_forecasting.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/automl_forecasting.json new file mode 100644 index 000000000000..de63de5ae955 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/automl_forecasting.json @@ -0,0 +1,42 @@ +{ + "properties": { + "computeId": "smoke-compute", + "experimentName": "smoke-experiment", + "isArchived": false, + "jobType": "AutoML", + "outputs": {}, + "properties": {}, + "tags": {}, + "taskDetails": { + "forecastingSettings": { + "forecastHorizon": { + "mode": "Custom", + "value": 12 + }, + "timeColumnName": "timestamp" + }, + "limitSettings": { + "maxConcurrentTrials": 2, + "maxTrials": 10, + "sweepConcurrentTrials": 0, + "sweepTrials": 0, + "timeout": "PT1H" + }, + "logVerbosity": "Info", + "primaryMetric": "NormalizedRootMeanSquaredError", + "targetColumnName": "target", + "taskType": "Forecasting", + "trainingData": { + "jobInputType": "mltable", + "uri": "azureml://datastores/workspaceblobstore/paths/smoke/train/" + }, + "trainingSettings": { + "enableStackEnsemble": false + }, + "validationData": { + "jobInputType": "mltable", + "uri": "azureml://datastores/workspaceblobstore/paths/smoke/valid/" + } + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/automl_image_classification.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/automl_image_classification.json new file mode 100644 index 000000000000..d85cf8e81a54 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/automl_image_classification.json @@ -0,0 +1,30 @@ +{ + "properties": { + "computeId": "smoke-compute", + "experimentName": "smoke-experiment", + "isArchived": false, + "jobType": "AutoML", + "outputs": {}, + "properties": {}, + "tags": {}, + "taskDetails": { + "limitSettings": { + "maxConcurrentTrials": 1, + "maxTrials": 2, + "timeout": "PT1H" + }, + "logVerbosity": "Info", + "primaryMetric": "Accuracy", + "targetColumnName": "label", + "taskType": "ImageClassification", + "trainingData": { + "jobInputType": "mltable", + "uri": "azureml://datastores/workspaceblobstore/paths/smoke/train/" + }, + "validationData": { + "jobInputType": "mltable", + "uri": "azureml://datastores/workspaceblobstore/paths/smoke/valid/" + } + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/automl_regression.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/automl_regression.json new file mode 100644 index 000000000000..b7870eed214d --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/automl_regression.json @@ -0,0 +1,33 @@ +{ + "properties": { + "computeId": "smoke-compute", + "experimentName": "smoke-experiment", + "isArchived": false, + "jobType": "AutoML", + "outputs": {}, + "properties": {}, + "tags": {}, + "taskDetails": { + "limitSettings": { + "maxConcurrentTrials": 2, + "maxTrials": 10, + "sweepConcurrentTrials": 0, + "sweepTrials": 0, + "timeout": "PT1H" + }, + "logVerbosity": "Info", + "primaryMetric": "R2Score", + "targetColumnName": "target", + "taskType": "Regression", + "trainingData": { + "jobInputType": "mltable", + "uri": "azureml://datastores/workspaceblobstore/paths/smoke/train/" + }, + "trainingSettings": {}, + "validationData": { + "jobInputType": "mltable", + "uri": "azureml://datastores/workspaceblobstore/paths/smoke/valid/" + } + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/automl_text_classification.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/automl_text_classification.json new file mode 100644 index 000000000000..71537639322a --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/automl_text_classification.json @@ -0,0 +1,30 @@ +{ + "properties": { + "computeId": "smoke-compute", + "experimentName": "smoke-experiment", + "isArchived": false, + "jobType": "AutoML", + "outputs": {}, + "properties": {}, + "tags": {}, + "taskDetails": { + "limitSettings": { + "maxConcurrentTrials": 1, + "maxNodes": 1, + "maxTrials": 2, + "timeout": "PT1H" + }, + "primaryMetric": "Accuracy", + "targetColumnName": "target", + "taskType": "TextClassification", + "trainingData": { + "jobInputType": "mltable", + "uri": "azureml://datastores/workspaceblobstore/paths/smoke/train/" + }, + "validationData": { + "jobInputType": "mltable", + "uri": "azureml://datastores/workspaceblobstore/paths/smoke/valid/" + } + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/automl_text_ner.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/automl_text_ner.json new file mode 100644 index 000000000000..18cf29af28e6 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/automl_text_ner.json @@ -0,0 +1,28 @@ +{ + "properties": { + "computeId": "smoke-compute", + "experimentName": "smoke-experiment", + "isArchived": false, + "jobType": "AutoML", + "outputs": {}, + "properties": {}, + "tags": {}, + "taskDetails": { + "limitSettings": { + "maxConcurrentTrials": 1, + "maxNodes": 1, + "maxTrials": 2, + "timeout": "PT1H" + }, + "taskType": "TextNER", + "trainingData": { + "jobInputType": "mltable", + "uri": "azureml://datastores/workspaceblobstore/paths/smoke/train/" + }, + "validationData": { + "jobInputType": "mltable", + "uri": "azureml://datastores/workspaceblobstore/paths/smoke/valid/" + } + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/batch_endpoint.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/batch_endpoint.json new file mode 100644 index 000000000000..c8a5716f252c --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/batch_endpoint.json @@ -0,0 +1,14 @@ +{ + "location": "westus", + "properties": { + "authMode": "aadToken", + "defaults": { + "deploymentName": "smoke-batch-deployment" + }, + "description": "smoke batch endpoint", + "properties": {} + }, + "tags": { + "tag1": "value1" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/blob_datastore_account_key.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/blob_datastore_account_key.json new file mode 100644 index 000000000000..2567503c0526 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/blob_datastore_account_key.json @@ -0,0 +1,20 @@ +{ + "properties": { + "accountName": "smokeaccount", + "containerName": "smoke-container", + "credentials": { + "credentialsType": "AccountKey", + "secrets": { + "key": "smoke-account-key", + "secretsType": "AccountKey" + } + }, + "datastoreType": "AzureBlob", + "description": "smoke blob datastore", + "endpoint": "core.windows.net", + "protocol": "https", + "tags": { + "tag1": "value1" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/blob_datastore_sas.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/blob_datastore_sas.json new file mode 100644 index 000000000000..11bed5645f70 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/blob_datastore_sas.json @@ -0,0 +1,17 @@ +{ + "properties": { + "accountName": "smokeaccount", + "containerName": "smoke-container", + "credentials": { + "credentialsType": "Sas", + "secrets": { + "sasToken": "?sv=smoke-sas-token", + "secretsType": "Sas" + } + }, + "datastoreType": "AzureBlob", + "endpoint": "core.windows.net", + "protocol": "https", + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/code_full.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/code_full.json new file mode 100644 index 000000000000..365e7585b694 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/code_full.json @@ -0,0 +1,7 @@ +{ + "properties": { + "codeUri": "azureml://datastores/workspaceblobstore/paths/smoke/code/", + "isAnonymous": false, + "properties": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_component.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_component.json new file mode 100644 index 000000000000..82a21078a832 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_component.json @@ -0,0 +1,49 @@ +{ + "properties": { + "componentSpec": { + "_source": "CLASS", + "command": "echo ${{inputs.learning_rate}} ${{inputs.data}} && echo ${{outputs.model}}", + "description": "smoke command component", + "display_name": "smoke command component", + "environment": "azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + "inputs": { + "data": { + "type": "uri_folder" + }, + "epochs": { + "default": "10", + "type": "integer" + }, + "flag": { + "default": "True", + "type": "boolean" + }, + "learning_rate": { + "default": "0.01", + "type": "number" + } + }, + "is_deterministic": true, + "name": "smoke_command_component", + "outputs": { + "model": { + "type": "uri_folder" + } + }, + "tags": { + "tag1": "value1" + }, + "type": "command", + "version": "1" + }, + "description": "smoke command component", + "isAnonymous": false, + "isArchived": false, + "properties": { + "client_component_hash": "9b70ca37-beee-f8b9-277e-8bf14a5eedd6" + }, + "tags": { + "tag1": "value1" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_aml_token.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_aml_token.json new file mode 100644 index 000000000000..70b30cb97c78 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_aml_token.json @@ -0,0 +1,17 @@ +{ + "properties": { + "command": "echo token", + "computeId": "smoke-compute", + "environmentId": "AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + "environmentVariables": {}, + "identity": { + "identityType": "AMLToken" + }, + "inputs": {}, + "isArchived": false, + "jobType": "Command", + "outputs": {}, + "properties": {}, + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_docker_args_list.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_docker_args_list.json new file mode 100644 index 000000000000..973498887611 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_docker_args_list.json @@ -0,0 +1,22 @@ +{ + "properties": { + "command": "echo docker", + "computeId": "smoke-compute", + "environmentId": "AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + "environmentVariables": {}, + "inputs": {}, + "isArchived": false, + "jobType": "Command", + "outputs": {}, + "properties": {}, + "resources": { + "dockerArgsList": [ + "--shm-size=1g", + "--ipc=host" + ], + "instanceCount": 1, + "properties": {} + }, + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_local_compute.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_local_compute.json new file mode 100644 index 000000000000..d062b80c508f --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_local_compute.json @@ -0,0 +1,20 @@ +{ + "properties": { + "command": "echo local", + "environmentId": "AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + "environmentVariables": {}, + "inputs": {}, + "isArchived": false, + "jobType": "Command", + "outputs": {}, + "properties": {}, + "resources": { + "properties": { + "IsLocal": { + "IsLocal": true + } + } + }, + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_managed_identity.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_managed_identity.json new file mode 100644 index 000000000000..09ed80910583 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_managed_identity.json @@ -0,0 +1,17 @@ +{ + "properties": { + "command": "echo managed", + "computeId": "smoke-compute", + "environmentId": "AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + "environmentVariables": {}, + "identity": { + "identityType": "Managed" + }, + "inputs": {}, + "isArchived": false, + "jobType": "Command", + "outputs": {}, + "properties": {}, + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_minimal.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_minimal.json new file mode 100644 index 000000000000..1e7cddfd7db9 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_minimal.json @@ -0,0 +1,14 @@ +{ + "properties": { + "command": "echo hello", + "computeId": "smoke-compute", + "environmentId": "AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + "environmentVariables": {}, + "inputs": {}, + "isArchived": false, + "jobType": "Command", + "outputs": {}, + "properties": {}, + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_pytorch.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_pytorch.json new file mode 100644 index 000000000000..2e516063a9fa --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_pytorch.json @@ -0,0 +1,22 @@ +{ + "properties": { + "command": "python train.py", + "computeId": "smoke-compute", + "distribution": { + "distributionType": "PyTorch", + "processCountPerInstance": 4 + }, + "environmentId": "AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + "environmentVariables": {}, + "inputs": {}, + "isArchived": false, + "jobType": "Command", + "outputs": {}, + "properties": {}, + "resources": { + "instanceCount": 2, + "properties": {} + }, + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_serverless.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_serverless.json new file mode 100644 index 000000000000..db1e3426531d --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_serverless.json @@ -0,0 +1,18 @@ +{ + "properties": { + "command": "echo serverless", + "environmentId": "AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + "environmentVariables": {}, + "inputs": {}, + "isArchived": false, + "jobType": "Command", + "outputs": {}, + "properties": {}, + "resources": { + "instanceCount": 1, + "instanceType": "STANDARD_DS3_V2", + "properties": {} + }, + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_tensorflow.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_tensorflow.json new file mode 100644 index 000000000000..cf15fc621d9b --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_tensorflow.json @@ -0,0 +1,23 @@ +{ + "properties": { + "command": "python train.py", + "computeId": "smoke-compute", + "distribution": { + "distributionType": "TensorFlow", + "parameterServerCount": 1, + "workerCount": 2 + }, + "environmentId": "AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + "environmentVariables": {}, + "inputs": {}, + "isArchived": false, + "jobType": "Command", + "outputs": {}, + "properties": {}, + "resources": { + "instanceCount": 2, + "properties": {} + }, + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_user_identity.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_user_identity.json new file mode 100644 index 000000000000..943359d463bc --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/command_job_user_identity.json @@ -0,0 +1,17 @@ +{ + "properties": { + "command": "echo user", + "computeId": "smoke-compute", + "environmentId": "AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + "environmentVariables": {}, + "identity": { + "identityType": "UserIdentity" + }, + "inputs": {}, + "isArchived": false, + "jobType": "Command", + "outputs": {}, + "properties": {}, + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/compute_instance_full.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/compute_instance_full.json new file mode 100644 index 000000000000..f7ec0e220346 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/compute_instance_full.json @@ -0,0 +1,38 @@ +{ + "identity": { + "type": "SystemAssigned" + }, + "properties": { + "computeType": "ComputeInstance", + "description": "smoke compute instance", + "disableLocalAuth": false, + "properties": { + "applicationSharingPolicy": "Shared", + "computeInstanceAuthorizationType": "personal", + "enableNodePublicIp": true, + "enableOSPatching": false, + "enableRootAccess": true, + "enableSSO": true, + "idleTimeBeforeShutdown": "PT30M", + "releaseQuotaOnStop": false, + "setupScripts": { + "scripts": { + "startupScript": { + "scriptArguments": "bash setup.sh", + "scriptData": "setup.sh", + "scriptSource": "workspaceStorage", + "timeout": "10m" + } + } + }, + "sshSettings": { + "adminPublicKey": "ssh-rsa AAAAB3Nz smoke", + "sshPublicAccess": "Enabled" + }, + "vmSize": "STANDARD_DS3_V2" + } + }, + "tags": { + "tag1": "value1" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/compute_instance_minimal.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/compute_instance_minimal.json new file mode 100644 index 000000000000..bfdfede3c61b --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/compute_instance_minimal.json @@ -0,0 +1,16 @@ +{ + "properties": { + "computeType": "ComputeInstance", + "disableLocalAuth": true, + "properties": { + "applicationSharingPolicy": "Shared", + "computeInstanceAuthorizationType": "personal", + "enableNodePublicIp": true, + "enableOSPatching": false, + "enableRootAccess": true, + "enableSSO": true, + "releaseQuotaOnStop": false, + "vmSize": "STANDARD_DS3_V2" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/custom_finetuning_minimal.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/custom_finetuning_minimal.json new file mode 100644 index 000000000000..879c4214a900 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/custom_finetuning_minimal.json @@ -0,0 +1,22 @@ +{ + "properties": { + "experimentName": "smoke-experiment", + "fineTuningDetails": { + "model": { + "jobInputType": "mlflow_model", + "uri": "azureml://registries/azureml-meta/models/Llama-2-7b/versions/9" + }, + "modelProvider": "Custom", + "taskType": "textCompletion", + "trainingData": { + "jobInputType": "uri_file", + "uri": "https://foo/bar/train.csv" + } + }, + "isArchived": false, + "jobType": "FineTuning", + "outputs": {}, + "properties": {}, + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/data_import_database.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/data_import_database.json new file mode 100644 index 000000000000..73108e1d65ab --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/data_import_database.json @@ -0,0 +1,17 @@ +{ + "assetName": "smoke-data-import", + "dataType": "uri_folder", + "dataUri": "azureml://datastores/workspaceblobstore/paths/smoke/imported/", + "description": "smoke data import", + "isAnonymous": false, + "isArchived": false, + "properties": {}, + "source": { + "connection": "azureml:my_connection", + "query": "SELECT * FROM my_table", + "sourceType": "database" + }, + "tags": { + "tag1": "value1" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/data_mltable.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/data_mltable.json new file mode 100644 index 000000000000..d924a6e91488 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/data_mltable.json @@ -0,0 +1,10 @@ +{ + "properties": { + "dataType": "mltable", + "dataUri": "azureml://datastores/workspaceblobstore/paths/smoke/mltable/", + "isAnonymous": false, + "isArchived": false, + "properties": {}, + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/data_uri_file.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/data_uri_file.json new file mode 100644 index 000000000000..de0c2861ad87 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/data_uri_file.json @@ -0,0 +1,10 @@ +{ + "properties": { + "dataType": "uri_file", + "dataUri": "azureml://datastores/workspaceblobstore/paths/smoke/data/file.csv", + "isAnonymous": false, + "isArchived": false, + "properties": {}, + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/data_uri_folder.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/data_uri_folder.json new file mode 100644 index 000000000000..fd27b4c81fbd --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/data_uri_folder.json @@ -0,0 +1,13 @@ +{ + "properties": { + "dataType": "uri_folder", + "dataUri": "azureml://datastores/workspaceblobstore/paths/smoke/data/", + "description": "smoke data", + "isAnonymous": false, + "isArchived": false, + "properties": {}, + "tags": { + "tag1": "value1" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/environment_build_context.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/environment_build_context.json new file mode 100644 index 000000000000..eb95cf074365 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/environment_build_context.json @@ -0,0 +1,10 @@ +{ + "properties": { + "build": { + "contextUri": "azureml://datastores/workspaceblobstore/paths/smoke/context/", + "dockerfilePath": "Dockerfile" + }, + "isAnonymous": false, + "isArchived": false + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/environment_image.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/environment_image.json new file mode 100644 index 000000000000..93770a3df5ae --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/environment_image.json @@ -0,0 +1,12 @@ +{ + "properties": { + "condaFile": "dependencies:\n- python=3.10\n- pip:\n - azure-ai-ml\nname: smoke\n", + "description": "smoke env", + "image": "mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu20.04:latest", + "isAnonymous": false, + "isArchived": false, + "tags": { + "tag1": "value1" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/feature_set.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/feature_set.json new file mode 100644 index 000000000000..ad7027a247f5 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/feature_set.json @@ -0,0 +1,16 @@ +{ + "properties": { + "description": "smoke feature set", + "entities": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/smoke-rg/providers/Microsoft.MachineLearningServices/workspaces/smoke-ws/featurestoreEntities/smoke-entity/versions/1" + ], + "properties": {}, + "specification": { + "path": "azureml://datastores/workspaceblobstore/paths/smoke/spec/" + }, + "stage": "Development", + "tags": { + "tag1": "value1" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/feature_store_entity.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/feature_store_entity.json new file mode 100644 index 000000000000..f84ab6b8d02d --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/feature_store_entity.json @@ -0,0 +1,20 @@ +{ + "properties": { + "description": "smoke feature store entity", + "indexColumns": [ + { + "columnName": "customer_id", + "dataType": "String" + }, + { + "columnName": "region_id", + "dataType": "Integer" + } + ], + "properties": {}, + "stage": "Development", + "tags": { + "tag1": "value1" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/file_datastore.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/file_datastore.json new file mode 100644 index 000000000000..2f04733aed1c --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/file_datastore.json @@ -0,0 +1,19 @@ +{ + "properties": { + "accountName": "smokeaccount", + "credentials": { + "credentialsType": "AccountKey", + "secrets": { + "key": "smoke-account-key", + "secretsType": "AccountKey" + } + }, + "datastoreType": "AzureFile", + "endpoint": "core.windows.net", + "fileShareName": "smoke-share", + "protocol": "https", + "tags": { + "tag1": "value1" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/import_data_schedule_database.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/import_data_schedule_database.json new file mode 100644 index 000000000000..bc0a39dfe539 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/import_data_schedule_database.json @@ -0,0 +1,31 @@ +{ + "properties": { + "action": { + "actionType": "ImportData", + "dataImportDefinition": { + "assetName": "smoke-azuresqldb-asset", + "dataType": "uri_folder", + "dataUri": "azureml://datastores/workspaceblobstore/paths/{name}", + "isAnonymous": false, + "isArchived": false, + "properties": {}, + "source": { + "connection": "azureml:smoke_connection", + "query": "select * from region", + "sourceType": "database" + }, + "tags": {} + } + }, + "displayName": "smoke-import-schedule-db-display", + "properties": {}, + "tags": {}, + "trigger": { + "endTime": "2026-12-31T00:00:00", + "expression": "15 10 * * 1", + "startTime": "2026-01-01T00:00:00", + "timeZone": "UTC", + "triggerType": "Cron" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/import_data_schedule_file_system.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/import_data_schedule_file_system.json new file mode 100644 index 000000000000..c8d9710c4753 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/import_data_schedule_file_system.json @@ -0,0 +1,43 @@ +{ + "properties": { + "action": { + "actionType": "ImportData", + "dataImportDefinition": { + "assetName": "smoke-s3-asset", + "dataType": "uri_folder", + "dataUri": "azureml://datastores/workspaceblobstore/paths/{name}", + "isAnonymous": false, + "isArchived": false, + "properties": {}, + "source": { + "connection": "azureml:smoke_s3_connection", + "path": "test1/*", + "sourceType": "file_system" + }, + "tags": {} + } + }, + "displayName": "smoke-import-schedule-fs-display", + "properties": {}, + "tags": {}, + "trigger": { + "frequency": "week", + "interval": 1, + "schedule": { + "hours": [ + 10 + ], + "minutes": [ + 15 + ], + "weekDays": [ + "monday", + "wednesday" + ] + }, + "startTime": "2026-01-01T00:00:00", + "timeZone": "UTC", + "triggerType": "Recurrence" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/import_job_file_source.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/import_job_file_source.json new file mode 100644 index 000000000000..04645e4cdcd5 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/import_job_file_source.json @@ -0,0 +1,30 @@ +{ + "properties": { + "command": "import", + "computeId": "smoke-compute", + "displayName": "smoke-import-file-display", + "environmentId": "smoke-compute", + "experimentName": "smoke-experiment", + "inputs": { + "connection": { + "jobInputType": "literal" + }, + "path": { + "jobInputType": "literal", + "value": "s3://my-bucket/my-folder/" + }, + "type": { + "jobInputType": "literal", + "value": "s3" + } + }, + "isArchived": false, + "jobType": "Command", + "outputs": { + "output": { + "jobOutputType": "uri_folder", + "uri": "azureml://datastores/workspaceblobstore/paths/imported-files/" + } + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/kubernetes_compute_full.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/kubernetes_compute_full.json new file mode 100644 index 000000000000..290efe4b4861 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/kubernetes_compute_full.json @@ -0,0 +1,14 @@ +{ + "identity": { + "type": "SystemAssigned" + }, + "properties": { + "computeType": "Kubernetes", + "description": "smoke kubernetes compute", + "properties": { + "defaultInstanceType": "defaultInstanceType", + "namespace": "smoke-namespace", + "vcName": "smoke-vc" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/managed_online_endpoint.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/managed_online_endpoint.json new file mode 100644 index 000000000000..bfa56e978047 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/managed_online_endpoint.json @@ -0,0 +1,18 @@ +{ + "identity": { + "type": "SystemAssigned" + }, + "location": "westus", + "properties": { + "authMode": "Key", + "description": "smoke online endpoint", + "mirrorTraffic": {}, + "properties": {}, + "traffic": { + "blue": 100 + } + }, + "tags": { + "tag1": "value1" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/model_full.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/model_full.json new file mode 100644 index 000000000000..70e81610977d --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/model_full.json @@ -0,0 +1,23 @@ +{ + "properties": { + "description": "smoke model", + "flavors": { + "python_function": { + "data": { + "loader_module": "smoke.loader" + } + } + }, + "isAnonymous": false, + "isArchived": false, + "modelType": "custom_model", + "modelUri": "azureml://datastores/workspaceblobstore/paths/smoke/model/", + "properties": { + "prop1": "value1" + }, + "stage": "Production", + "tags": { + "tag1": "value1" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/model_mlflow.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/model_mlflow.json new file mode 100644 index 000000000000..3b40c80a8a83 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/model_mlflow.json @@ -0,0 +1,10 @@ +{ + "properties": { + "isAnonymous": false, + "isArchived": false, + "modelType": "mlflow_model", + "modelUri": "azureml://datastores/workspaceblobstore/paths/smoke/mlflow-model/", + "properties": {}, + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_custom.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_custom.json new file mode 100644 index 000000000000..e4fab5bc7344 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_custom.json @@ -0,0 +1,115 @@ +{ + "properties": { + "action": { + "actionType": "CreateMonitor", + "monitorDefinition": { + "computeConfiguration": { + "computeIdentity": { + "computeIdentityType": "AmlToken" + }, + "computeType": "ServerlessSpark", + "instanceType": "standard_e8s_v3", + "runtimeVersion": "3.4" + }, + "monitoringTarget": { + "deploymentId": "fake_endpoint_id", + "taskType": "classification" + }, + "signals": { + "testSignal": { + "componentId": "fake_component:1", + "inputAssets": { + "test_fixed": { + "dataContext": "test", + "inputDataType": "Fixed", + "jobInputType": "mltable", + "uri": "Direct:1" + }, + "test_static": { + "dataContext": "test", + "inputDataType": "Static", + "jobInputType": "mltable", + "uri": "Direct:1", + "windowEnd": "2023-07-17T00:00:00.000Z", + "windowStart": "2023-07-12T00:00:00.000Z" + }, + "test_trailing": { + "dataContext": "test", + "inputDataType": "Trailing", + "jobInputType": "mltable", + "uri": "Direct:1", + "windowOffset": "P7D", + "windowSize": "P30D" + } + }, + "inputs": { + "input_1": { + "jobInputType": "mltable", + "uri": "Direct:1" + }, + "input_2": { + "jobInputType": "mltable", + "uri": "Direct:2" + } + }, + "metricThresholds": [ + { + "metric": "metric1", + "threshold": { + "value": 0.1 + } + }, + { + "metric": "metric2", + "threshold": { + "value": 0.2 + } + } + ], + "mode": "Enabled", + "signalType": "Custom", + "workspaceConnection": { + "environmentVariables": { + "ENV_VAR_1": "value1", + "ENV_VAR_2": "value2" + }, + "secrets": { + "SECRET_1": "secret1", + "SECRET_2": "secret2" + } + } + } + } + } + }, + "properties": { + "prop1": "value" + }, + "tags": { + "tag1": "tag" + }, + "trigger": { + "frequency": "week", + "interval": 1, + "schedule": { + "hours": [ + 22, + 20 + ], + "minutes": [ + 0, + 0 + ], + "weekDays": [ + "monday", + "tuesday", + "wednesday", + "thursday", + "friday" + ] + }, + "timeZone": "utc", + "triggerType": "Recurrence" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_data_drift.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_data_drift.json new file mode 100644 index 000000000000..6b81b6ee5251 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_data_drift.json @@ -0,0 +1,100 @@ +{ + "properties": { + "action": { + "actionType": "CreateMonitor", + "monitorDefinition": { + "alertNotificationSetting": { + "alertNotificationType": "Email", + "emailNotificationSetting": { + "emailOn": [ + "JobFailed", + "JobCompleted" + ], + "emails": [ + "test@example.com" + ] + } + }, + "computeConfiguration": { + "computeIdentity": { + "computeIdentityType": "AmlToken" + }, + "computeType": "ServerlessSpark", + "instanceType": "standard_e8s_v3", + "runtimeVersion": "3.4" + }, + "monitoringTarget": { + "deploymentId": "fake_endpoint_id", + "taskType": "classification" + }, + "signals": { + "testSignal": { + "metricThresholds": [ + { + "dataType": "Numerical", + "metric": "jensenShannonDistance", + "threshold": { + "value": 0.5 + } + }, + { + "dataType": "Categorical", + "metric": "pearsonsChiSquaredTest", + "threshold": { + "value": 0.2 + } + } + ], + "mode": "Enabled", + "productionData": { + "dataContext": "test", + "inputDataType": "Trailing", + "jobInputType": "mltable", + "uri": "Direct:1", + "windowOffset": "P0D", + "windowSize": "P60D" + }, + "referenceData": { + "dataContext": "test", + "inputDataType": "Trailing", + "jobInputType": "mltable", + "uri": "Direct:1", + "windowOffset": "P30D", + "windowSize": "P30D" + }, + "signalType": "DataDrift" + } + } + } + }, + "properties": { + "prop1": "value" + }, + "tags": { + "tag1": "value" + }, + "trigger": { + "frequency": "week", + "interval": 1, + "schedule": { + "hours": [ + 22, + 20 + ], + "minutes": [ + 0, + 30 + ], + "weekDays": [ + "monday", + "tuesday", + "wednesday", + "thursday", + "friday" + ] + }, + "timeZone": "utc", + "triggerType": "Recurrence" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_data_quality.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_data_quality.json new file mode 100644 index 000000000000..9f647667ba86 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_data_quality.json @@ -0,0 +1,105 @@ +{ + "properties": { + "action": { + "actionType": "CreateMonitor", + "monitorDefinition": { + "alertNotificationSetting": { + "alertNotificationType": "Email", + "emailNotificationSetting": { + "emailOn": [ + "JobFailed", + "JobCompleted" + ], + "emails": [ + "test@example.com" + ] + } + }, + "computeConfiguration": { + "computeIdentity": { + "computeIdentityType": "AmlToken" + }, + "computeType": "ServerlessSpark", + "instanceType": "standard_e8s_v3", + "runtimeVersion": "3.4" + }, + "monitoringTarget": { + "deploymentId": "fake_endpoint_id", + "taskType": "classification" + }, + "signals": { + "testSignal": { + "metricThresholds": [ + { + "dataType": "Numerical", + "metric": "nullValueRate", + "threshold": { + "value": 0.5 + } + }, + { + "dataType": "Numerical", + "metric": "outOfBoundsRate", + "threshold": { + "value": 0.2 + } + }, + { + "dataType": "Categorical", + "metric": "outOfBoundsRate", + "threshold": { + "value": 0.2 + } + } + ], + "mode": "Enabled", + "productionData": { + "dataContext": "test", + "inputDataType": "Trailing", + "jobInputType": "mltable", + "uri": "Direct:1", + "windowOffset": "P0D", + "windowSize": "P60D" + }, + "referenceData": { + "dataContext": "test", + "inputDataType": "Fixed", + "jobInputType": "mltable", + "uri": "Direct:1" + }, + "signalType": "DataQuality" + } + } + } + }, + "properties": { + "prop1": "value" + }, + "tags": { + "tag1": "tag" + }, + "trigger": { + "frequency": "week", + "interval": 1, + "schedule": { + "hours": [ + 22, + 20 + ], + "minutes": [ + 0, + 30 + ], + "weekDays": [ + "monday", + "tuesday", + "wednesday", + "thursday", + "friday" + ] + }, + "timeZone": "utc", + "triggerType": "Recurrence" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_feature_attribution_drift.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_feature_attribution_drift.json new file mode 100644 index 000000000000..2694ca1300a9 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_feature_attribution_drift.json @@ -0,0 +1,97 @@ +{ + "properties": { + "action": { + "actionType": "CreateMonitor", + "monitorDefinition": { + "computeConfiguration": { + "computeIdentity": { + "computeIdentityType": "AmlToken" + }, + "computeType": "ServerlessSpark", + "instanceType": "standard_e8s_v3", + "runtimeVersion": "3.4" + }, + "monitoringTarget": { + "deploymentId": "fake_endpoint_id", + "taskType": "classification" + }, + "signals": { + "testSignal": { + "metricThreshold": { + "metric": "normalizedDiscountedCumulativeGain", + "threshold": { + "value": 0.2 + } + }, + "mode": "Enabled", + "productionData": [ + { + "columns": { + "correlation_id": "inference_correlation_id" + }, + "dataContext": "model_inputs", + "inputDataType": "Trailing", + "jobInputType": "mltable", + "uri": "my_model_inputs_data:1", + "windowOffset": "P0D", + "windowSize": "P7D" + }, + { + "columns": { + "correlation_id": "inference_correlation_id", + "prediction": "is_fraud", + "prediction_probability": "is_fraud_probability" + }, + "dataContext": "model_outputs", + "inputDataType": "Trailing", + "jobInputType": "mltable", + "uri": "my_model_outputs_data:1", + "windowOffset": "P0D", + "windowSize": "P7D" + } + ], + "referenceData": { + "columns": { + "target_column": "target" + }, + "dataContext": "training", + "inputDataType": "Fixed", + "jobInputType": "mltable", + "uri": "my_model_training_data:1" + }, + "signalType": "FeatureAttributionDrift" + } + } + } + }, + "properties": { + "prop1": "value" + }, + "tags": { + "tag1": "tag" + }, + "trigger": { + "frequency": "week", + "interval": 1, + "schedule": { + "hours": [ + 22, + 20 + ], + "minutes": [ + 0, + 0 + ], + "weekDays": [ + "monday", + "tuesday", + "wednesday", + "thursday", + "friday" + ] + }, + "timeZone": "utc", + "triggerType": "Recurrence" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_generation_safety.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_generation_safety.json new file mode 100644 index 000000000000..099420b79921 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_generation_safety.json @@ -0,0 +1,108 @@ +{ + "properties": { + "action": { + "actionType": "CreateMonitor", + "monitorDefinition": { + "computeConfiguration": { + "computeIdentity": { + "computeIdentityType": "AmlToken" + }, + "computeType": "ServerlessSpark", + "instanceType": "standard_e8s_v3", + "runtimeVersion": "3.4" + }, + "monitoringTarget": { + "deploymentId": "fake_endpoint_id", + "taskType": "classification" + }, + "signals": { + "testSignal": { + "metricThresholds": [ + { + "metric": "AcceptableGroundednessScorePerInstance", + "threshold": { + "value": 3.0 + } + }, + { + "metric": "AggregatedGroundednessPassRate", + "threshold": { + "value": 0.01 + } + }, + { + "metric": "AcceptableFluencyScorePerInstance", + "threshold": { + "value": 3.0 + } + }, + { + "metric": "AggregatedFluencyPassRate", + "threshold": { + "value": 0.02 + } + } + ], + "mode": "Enabled", + "productionData": [ + { + "columns": { + "correlation_id": "inference_correlation_id" + }, + "inputDataType": "Trailing", + "jobInputType": "mltable", + "uri": "my_model_inputs_data:1", + "windowOffset": "P0D", + "windowSize": "P7D" + }, + { + "columns": { + "correlation_id": "inference_correlation_id", + "prediction": "is_fraud", + "prediction_probability": "is_fraud_probability" + }, + "inputDataType": "Trailing", + "jobInputType": "mltable", + "uri": "my_model_outputs_data:1", + "windowOffset": "P0D", + "windowSize": "P7D" + } + ], + "samplingRate": 1.0, + "signalType": "GenerationSafetyQuality", + "workspaceConnectionId": "fake_workspace_connection_id" + } + } + } + }, + "properties": { + "prop1": "value" + }, + "tags": { + "tag1": "tag" + }, + "trigger": { + "frequency": "week", + "interval": 1, + "schedule": { + "hours": [ + 22, + 20 + ], + "minutes": [ + 0, + 30 + ], + "weekDays": [ + "monday", + "tuesday", + "wednesday", + "thursday", + "friday" + ] + }, + "timeZone": "utc", + "triggerType": "Recurrence" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_generation_token_statistics.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_generation_token_statistics.json new file mode 100644 index 000000000000..1bb9dd09b772 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_generation_token_statistics.json @@ -0,0 +1,75 @@ +{ + "properties": { + "action": { + "actionType": "CreateMonitor", + "monitorDefinition": { + "computeConfiguration": { + "computeIdentity": { + "computeIdentityType": "AmlToken" + }, + "computeType": "ServerlessSpark", + "instanceType": "standard_e8s_v3", + "runtimeVersion": "3.4" + }, + "monitoringTarget": { + "deploymentId": "azureml:va-endpoint:va-deployment", + "taskType": "questionanswering" + }, + "signals": { + "testSignal": { + "metricThresholds": [ + { + "metric": "TotalTokenCount", + "threshold": { + "value": 3.0 + } + }, + { + "metric": "TotalTokenCountPerGroup", + "threshold": { + "value": 10.0 + } + } + ], + "mode": "Enabled", + "productionData": { + "columns": { + "completion_column": "answer", + "prompt_column": "question" + }, + "inputDataType": "Trailing", + "jobInputType": "mltable", + "uri": "my_model_inputs_data:1", + "windowOffset": "P0D", + "windowSize": "P7D" + }, + "samplingRate": 0.1, + "signalType": "GenerationTokenStatistics" + } + } + } + }, + "properties": { + "prop1": "value" + }, + "tags": { + "tag1": "tag" + }, + "trigger": { + "frequency": "day", + "interval": 1, + "schedule": { + "hours": [ + 22, + 20 + ], + "minutes": [ + 0, + 30 + ] + }, + "timeZone": "UTC", + "triggerType": "Recurrence" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_model_performance.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_model_performance.json new file mode 100644 index 000000000000..6954317a5cf7 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_model_performance.json @@ -0,0 +1,92 @@ +{ + "properties": { + "action": { + "actionType": "CreateMonitor", + "monitorDefinition": { + "computeConfiguration": { + "computeIdentity": { + "computeIdentityType": "AmlToken" + }, + "computeType": "ServerlessSpark", + "instanceType": "standard_e4s_v3", + "runtimeVersion": "3.4" + }, + "monitoringTarget": { + "deploymentId": "fake_endpoint_id", + "taskType": "classification" + }, + "signals": { + "testSignal": { + "metricThreshold": { + "metric": "Accuracy", + "modelType": "Classification", + "threshold": { + "value": 0.9 + } + }, + "mode": "Disabled", + "productionData": [ + { + "columns": { + "join_column": "correlationid", + "target_column": "classification-targetvalue" + }, + "dataContext": "model_inputs", + "inputDataType": "Trailing", + "jobInputType": "mltable", + "uri": "Direct:1", + "windowOffset": "P0D", + "windowSize": "P7D" + } + ], + "properties": { + "azureml.modelmonitor.model_performance_thresholds": "[{\"modelType\":\"classification\",\"metric\":\"Accuracy\",\"threshold\":{\"value\":0.9}}]" + }, + "referenceData": { + "columns": { + "join_column": "correlationid", + "target_column": "classification" + }, + "dataContext": "model_inputs", + "inputDataType": "Trailing", + "jobInputType": "mltable", + "uri": "Direct:1", + "windowOffset": "P0D", + "windowSize": "P7D" + }, + "signalType": "ModelPerformance" + } + } + } + }, + "properties": { + "prop1": "value" + }, + "tags": { + "tag1": "tag" + }, + "trigger": { + "frequency": "week", + "interval": 1, + "schedule": { + "hours": [ + 22, + 20 + ], + "minutes": [ + 0, + 30 + ], + "weekDays": [ + "monday", + "tuesday", + "wednesday", + "thursday", + "friday" + ] + }, + "timeZone": "utc", + "triggerType": "Recurrence" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_no_target_baseline_data.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_no_target_baseline_data.json new file mode 100644 index 000000000000..027a19cda75f --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_no_target_baseline_data.json @@ -0,0 +1,111 @@ +{ + "properties": { + "action": { + "actionType": "CreateMonitor", + "monitorDefinition": { + "computeConfiguration": { + "computeIdentity": { + "computeIdentityType": "AmlToken" + }, + "computeType": "ServerlessSpark", + "instanceType": "standard_e8s_v3", + "runtimeVersion": "3.4" + }, + "monitoringTarget": { + "deploymentId": "azureml:iris-endpoint:my-iris-deployment", + "taskType": "classification" + }, + "signals": { + "data-drift-signal": { + "metricThresholds": [ + { + "dataType": "Numerical", + "metric": "jensenShannonDistance", + "threshold": { + "value": 0.5 + } + }, + { + "dataType": "Categorical", + "metric": "pearsonsChiSquaredTest", + "threshold": { + "value": 0.2 + } + } + ], + "mode": "Disabled", + "signalType": "DataDrift" + }, + "data-quality-signal": { + "metricThresholds": [ + { + "dataType": "Numerical", + "metric": "nullValueRate", + "threshold": { + "value": 0.5 + } + }, + { + "dataType": "Categorical", + "metric": "outOfBoundsRate", + "threshold": { + "value": 0.2 + } + } + ], + "mode": "Disabled", + "signalType": "DataQuality" + }, + "prediction-drift-signal": { + "metricThresholds": [ + { + "dataType": "Numerical", + "metric": "jensenShannonDistance", + "threshold": { + "value": 0.5 + } + }, + { + "dataType": "Categorical", + "metric": "pearsonsChiSquaredTest", + "threshold": { + "value": 0.2 + } + } + ], + "mode": "Disabled", + "modelType": "classification", + "signalType": "PredictionDrift" + } + } + } + }, + "description": "Loan approval model monitoring setup with minimal configurations", + "displayName": "Loan Approval model monitoring", + "properties": {}, + "tags": {}, + "trigger": { + "frequency": "week", + "interval": 1, + "schedule": { + "hours": [ + 22, + 20 + ], + "minutes": [ + 0, + 30 + ], + "weekDays": [ + "monday", + "tuesday", + "wednesday", + "thursday", + "friday" + ] + }, + "timeZone": "utc", + "triggerType": "Recurrence" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_prediction_drift.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_prediction_drift.json new file mode 100644 index 000000000000..e61decf427d6 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/monitor_prediction_drift.json @@ -0,0 +1,99 @@ +{ + "properties": { + "action": { + "actionType": "CreateMonitor", + "monitorDefinition": { + "alertNotificationSetting": { + "alertNotificationType": "Email", + "emailNotificationSetting": { + "emailOn": [ + "JobFailed", + "JobCompleted" + ], + "emails": [ + "test@example.com" + ] + } + }, + "computeConfiguration": { + "computeIdentity": { + "computeIdentityType": "AmlToken" + }, + "computeType": "ServerlessSpark", + "instanceType": "standard_e8s_v3", + "runtimeVersion": "3.4" + }, + "monitoringTarget": { + "deploymentId": "fake_endpoint_id", + "taskType": "classification" + }, + "signals": { + "testSignal": { + "metricThresholds": [ + { + "dataType": "Numerical", + "metric": "jensenShannonDistance", + "threshold": { + "value": 0.5 + } + }, + { + "dataType": "Categorical", + "metric": "populationStabilityIndex", + "threshold": { + "value": 0.2 + } + } + ], + "mode": "Enabled", + "modelType": "classification", + "productionData": { + "dataContext": "test", + "inputDataType": "Trailing", + "jobInputType": "mltable", + "uri": "Direct:1", + "windowOffset": "P0D", + "windowSize": "P60D" + }, + "referenceData": { + "dataContext": "test", + "inputDataType": "Fixed", + "jobInputType": "mltable", + "uri": "Direct:1" + }, + "signalType": "PredictionDrift" + } + } + } + }, + "properties": { + "prop1": "value" + }, + "tags": { + "tag1": "tag" + }, + "trigger": { + "frequency": "week", + "interval": 1, + "schedule": { + "hours": [ + 22, + 20 + ], + "minutes": [ + 0, + 30 + ], + "weekDays": [ + "monday", + "tuesday", + "wednesday", + "thursday", + "friday" + ] + }, + "timeZone": "utc", + "triggerType": "Recurrence" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/one_lake_datastore.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/one_lake_datastore.json new file mode 100644 index 000000000000..6481d3048af0 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/one_lake_datastore.json @@ -0,0 +1,22 @@ +{ + "properties": { + "artifact": { + "artifactName": "smoke-lakehouse", + "artifactType": "LakeHouse" + }, + "credentials": { + "authorityUrl": "https://login.microsoftonline.com", + "clientId": "11111111-1111-1111-1111-111111111111", + "credentialsType": "ServicePrincipal", + "secrets": { + "clientSecret": "smoke-secret", + "secretsType": "ServicePrincipal" + }, + "tenantId": "00000000-0000-0000-0000-000000000000" + }, + "datastoreType": "OneLake", + "endpoint": "onelake.dfs.fabric.microsoft.com", + "oneLakeWorkspaceName": "smoke-onelake-workspace", + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/registry_full.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/registry_full.json new file mode 100644 index 000000000000..d89afe45415f --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/registry_full.json @@ -0,0 +1,22 @@ +{ + "identity": { + "type": "SystemAssigned" + }, + "location": "westus", + "properties": { + "managedResourceGroupTags": { + "tag1": "value1" + }, + "publicNetworkAccess": "Enabled", + "regionDetails": [ + { + "acrDetails": [], + "location": "westus", + "storageAccountDetails": [] + } + ] + }, + "tags": { + "tag1": "value1" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/schedule_cron_datetime.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/schedule_cron_datetime.json new file mode 100644 index 000000000000..3c5ec4473cba --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/schedule_cron_datetime.json @@ -0,0 +1,29 @@ +{ + "properties": { + "action": { + "actionType": "CreateJob", + "jobDefinition": { + "command": "echo scheduled", + "computeId": "smoke-compute", + "environmentId": "AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + "environmentVariables": {}, + "inputs": {}, + "isArchived": false, + "jobType": "Command", + "outputs": {}, + "properties": {}, + "tags": {} + } + }, + "displayName": "smoke-schedule-cron-datetime-display", + "properties": {}, + "tags": {}, + "trigger": { + "endTime": "2026-12-31 00:00:00", + "expression": "15 10 * * 1", + "startTime": "2026-01-01 00:00:00", + "timeZone": "UTC", + "triggerType": "Cron" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/schedule_pipeline.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/schedule_pipeline.json new file mode 100644 index 000000000000..06e5f3a3eb6c --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/schedule_pipeline.json @@ -0,0 +1,43 @@ +{ + "properties": { + "action": { + "actionType": "CreateJob", + "jobDefinition": { + "inputs": {}, + "isArchived": false, + "jobType": "Pipeline", + "jobs": { + "node1": { + "_source": "BUILDER", + "componentId": "name: node1\ntype: command\ninputs:\n x:\n type: integer\n default: '1'\ncommand: echo ${{inputs.x}}\nenvironment: azureml:AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33\nis_deterministic: true\n", + "computeId": "smoke-compute", + "inputs": { + "x": { + "job_input_type": "literal", + "value": "1" + } + }, + "name": "node1", + "type": "command" + } + }, + "outputs": {}, + "properties": {}, + "settings": { + "_source": "CLASS", + "default_compute": "smoke-compute" + }, + "tags": {} + } + }, + "displayName": "smoke-schedule-pipeline-display", + "properties": {}, + "tags": {}, + "trigger": { + "expression": "15 10 * * 1", + "startTime": "2026-01-01T00:00:00", + "timeZone": "UTC", + "triggerType": "Cron" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/schedule_recurrence_spark.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/schedule_recurrence_spark.json new file mode 100644 index 000000000000..3f2afcfb0633 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/schedule_recurrence_spark.json @@ -0,0 +1,50 @@ +{ + "properties": { + "action": { + "actionType": "CreateJob", + "jobDefinition": { + "codeId": "./src", + "computeId": "smoke-spark-compute", + "conf": { + "spark.driver.cores": "1", + "spark.driver.memory": "2g", + "spark.executor.cores": "2", + "spark.executor.instances": "2", + "spark.executor.memory": "2g" + }, + "entry": { + "file": "main.py", + "sparkJobEntryType": "SparkJobPythonEntry" + }, + "inputs": {}, + "isArchived": false, + "jobType": "Spark", + "outputs": {}, + "properties": {}, + "tags": {} + } + }, + "displayName": "smoke-schedule-recurrence-display", + "properties": {}, + "tags": {}, + "trigger": { + "frequency": "week", + "interval": 1, + "schedule": { + "hours": [ + 10 + ], + "minutes": [ + 15 + ], + "weekDays": [ + "monday", + "wednesday" + ] + }, + "startTime": "2026-01-01T00:00:00", + "timeZone": "UTC", + "triggerType": "Recurrence" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/spark_component.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/spark_component.json new file mode 100644 index 000000000000..a7ddc1fecfe6 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/spark_component.json @@ -0,0 +1,49 @@ +{ + "properties": { + "componentSpec": { + "_source": "CLASS", + "args": "--input ${{inputs.data}} --output ${{outputs.output}}", + "code": "azureml:./src", + "conf": { + "spark.driver.cores": 1, + "spark.driver.memory": "2g", + "spark.executor.cores": 2, + "spark.executor.instances": 2, + "spark.executor.memory": "2g" + }, + "description": "smoke spark component", + "display_name": "smoke spark component", + "entry": { + "file": "main.py" + }, + "inputs": { + "data": { + "mode": "direct", + "type": "uri_file" + } + }, + "is_deterministic": true, + "name": "smoke_spark_component", + "outputs": { + "output": { + "mode": "direct", + "type": "uri_folder" + } + }, + "tags": { + "tag1": "value1" + }, + "type": "spark", + "version": "1" + }, + "description": "smoke spark component", + "isAnonymous": false, + "isArchived": false, + "properties": { + "client_component_hash": "4578f78a-68a0-60eb-78be-b9f5a3cd467a" + }, + "tags": { + "tag1": "value1" + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/spark_job_dynamic_allocation.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/spark_job_dynamic_allocation.json new file mode 100644 index 000000000000..e1066caa41ae --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/spark_job_dynamic_allocation.json @@ -0,0 +1,33 @@ +{ + "properties": { + "codeId": "./src", + "conf": { + "spark.driver.cores": "2", + "spark.driver.memory": "4g", + "spark.dynamicAllocation.enabled": "True", + "spark.dynamicAllocation.maxExecutors": "4", + "spark.dynamicAllocation.minExecutors": "1", + "spark.executor.cores": "2", + "spark.executor.instances": "1", + "spark.executor.memory": "4g" + }, + "entry": { + "file": "main.py", + "sparkJobEntryType": "SparkJobPythonEntry" + }, + "experimentName": "smoke-experiment", + "identity": { + "identityType": "AMLToken" + }, + "inputs": {}, + "isArchived": false, + "jobType": "Spark", + "outputs": {}, + "properties": {}, + "resources": { + "instanceType": "Standard_E8S_V3", + "runtimeVersion": "3.4.0" + }, + "tags": {} + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/sweep_job_median_policy.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/sweep_job_median_policy.json new file mode 100644 index 000000000000..4a3e86e6ae85 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/sweep_job_median_policy.json @@ -0,0 +1,45 @@ +{ + "properties": { + "computeId": "smoke-compute", + "earlyTermination": { + "delayEvaluation": 5, + "evaluationInterval": 1, + "policyType": "MedianStopping" + }, + "experimentName": "smoke-experiment", + "inputs": {}, + "isArchived": false, + "jobType": "Sweep", + "limits": { + "jobLimitsType": "Sweep", + "maxConcurrentTrials": 2, + "maxTotalTrials": 4 + }, + "objective": { + "goal": "minimize", + "primaryMetric": "loss" + }, + "outputs": {}, + "properties": {}, + "samplingAlgorithm": { + "samplingAlgorithmType": "Grid" + }, + "searchSpace": { + "learning_rate": [ + "choice", + [ + [ + 0.01, + 0.1 + ] + ] + ] + }, + "tags": {}, + "trial": { + "command": "python train.py --lr ${{search_space.learning_rate}}", + "environmentId": "AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + "environmentVariables": {} + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/sweep_job_truncation_policy.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/sweep_job_truncation_policy.json new file mode 100644 index 000000000000..6bf9d83e07d5 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/sweep_job_truncation_policy.json @@ -0,0 +1,58 @@ +{ + "properties": { + "computeId": "smoke-compute", + "earlyTermination": { + "delayEvaluation": 5, + "evaluationInterval": 2, + "policyType": "TruncationSelection", + "truncationPercentage": 20 + }, + "experimentName": "smoke-experiment", + "inputs": {}, + "isArchived": false, + "jobType": "Sweep", + "limits": { + "jobLimitsType": "Sweep", + "maxConcurrentTrials": 4, + "maxTotalTrials": 8 + }, + "objective": { + "goal": "maximize", + "primaryMetric": "accuracy" + }, + "outputs": {}, + "properties": {}, + "samplingAlgorithm": { + "samplingAlgorithmType": "Bayesian" + }, + "searchSpace": { + "dropout": [ + "quniform", + [ + 0.0, + 0.5, + 1 + ] + ], + "lr": [ + "loguniform", + [ + -6, + -1 + ] + ], + "units": [ + "randint", + [ + 128 + ] + ] + }, + "tags": {}, + "trial": { + "command": "python train.py --lr ${{search_space.lr}} --units ${{search_space.units}}", + "environmentId": "AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", + "environmentVariables": {} + } + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/synapse_spark_compute_full.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/synapse_spark_compute_full.json new file mode 100644 index 000000000000..b6f22de92940 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/synapse_spark_compute_full.json @@ -0,0 +1,12 @@ +{ + "identity": { + "type": "SystemAssigned" + }, + "properties": { + "computeType": "SynapseSpark", + "description": "smoke synapse spark compute" + }, + "tags": { + "tag1": "value1" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/virtual_machine_compute_full.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/virtual_machine_compute_full.json new file mode 100644 index 000000000000..d73d988e89e2 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/virtual_machine_compute_full.json @@ -0,0 +1,17 @@ +{ + "properties": { + "computeType": "VirtualMachine", + "description": "smoke vm compute", + "properties": { + "administratorAccount": { + "password": "smoke-password", + "username": "azureuser" + }, + "sshPort": 22 + }, + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/smoke-rg/providers/Microsoft.Compute/virtualMachines/smoke-vm" + }, + "tags": { + "tag1": "value1" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/workspace_full.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/workspace_full.json new file mode 100644 index 000000000000..813330a36d1f --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/workspace_full.json @@ -0,0 +1,17 @@ +{ + "identity": { + "type": "SystemAssigned" + }, + "kind": "default", + "location": "westus", + "properties": { + "description": "smoke workspace", + "enableDataIsolation": false, + "friendlyName": "Smoke Workspace", + "hbiWorkspace": false, + "publicNetworkAccess": "Enabled" + }, + "tags": { + "tag1": "value1" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/workspace_minimal.json b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/workspace_minimal.json new file mode 100644 index 000000000000..e0ac97baddcc --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/expected_wire/workspace_minimal.json @@ -0,0 +1,9 @@ +{ + "kind": "default", + "location": "westus", + "properties": { + "enableDataIsolation": false, + "hbiWorkspace": false + }, + "tags": {} +} diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/regenerate_expected_wire.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/regenerate_expected_wire.py index f663973a74f7..d7f477a7f5e4 100644 --- a/sdk/ml/azure-ai-ml/tests/smoke_serialization/regenerate_expected_wire.py +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/regenerate_expected_wire.py @@ -12,10 +12,12 @@ The baselines represent the known-correct (pre-migration) wire and are the source of truth. NEVER regenerate them from a migration branch — that would make the equivalence check circular and meaningless. Only regenerate from main, or from a commit whose wire is independently known-correct. -""" -import sys +Builders are auto-discovered from every ``_builders*.py`` module (see ``_registry.all_builders``), so +adding a new family module requires no edit here. +""" import os +import sys from azure.ai.ml._utils.utils import AZUREML_PRIVATE_FEATURES_ENV_VAR @@ -23,36 +25,28 @@ # so ImportJob and other private-preview entities serialize identically at capture and at assert time. os.environ[AZUREML_PRIVATE_FEATURES_ENV_VAR] = "true" -from _builders import ( - AOAI_FINETUNING_BUILDERS, - COMMAND_JOB_BUILDERS, - FINETUNING_BUILDERS, - IMPORT_JOB_BUILDERS, - SCHEDULE_BUILDERS, - SPARK_JOB_BUILDERS, - SWEEP_JOB_BUILDERS, -) +from _registry import all_builders from _wire import save_expected_wire, serialize_wire def main(): """Capture every builder's wire into expected_wire/.json.""" - all_builders = {} - all_builders.update(COMMAND_JOB_BUILDERS) - all_builders.update(SWEEP_JOB_BUILDERS) - all_builders.update(SPARK_JOB_BUILDERS) - all_builders.update(IMPORT_JOB_BUILDERS) - all_builders.update(SCHEDULE_BUILDERS) - all_builders.update(FINETUNING_BUILDERS) - all_builders.update(AOAI_FINETUNING_BUILDERS) - - for name in sorted(all_builders): - entity = all_builders[name]() - wire = serialize_wire(entity._to_rest_object()) - save_expected_wire(name, wire) - print("wrote baseline:", name) - - print("done: {0} baseline(s)".format(len(all_builders))) + builders = all_builders() + failures = [] + for name in sorted(builders): + try: + wire = serialize_wire(builders[name]()._to_rest_object()) + save_expected_wire(name, wire) + print("wrote baseline:", name) + except Exception as exc: # noqa: BLE001 - report all, fail at end + failures.append((name, type(exc).__name__ + ": " + str(exc)[:200])) + + print("done: {0} baseline(s)".format(len(builders) - len(failures))) + if failures: + print("FAILURES ({0}):".format(len(failures))) + for name, msg in failures: + print(" FAIL", name, "->", msg) + return 1 return 0 diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_asset_wire.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_asset_wire.py new file mode 100644 index 000000000000..50b283cb5250 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_asset_wire.py @@ -0,0 +1,31 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Wire-serialization smoke tests for asset entities (Model, Environment, Data, Code). + +See ``test_command_job_wire.py`` for the two-check pattern (serialization guard + wire equivalence). +""" +import pytest + +from _builders_asset import CODE_BUILDERS, DATA_BUILDERS, ENVIRONMENT_BUILDERS, MODEL_BUILDERS +from _wire import assert_wire_matches_expected, assert_serializes + +_ALL = {} +_ALL.update(MODEL_BUILDERS) +_ALL.update(ENVIRONMENT_BUILDERS) +_ALL.update(DATA_BUILDERS) +_ALL.update(CODE_BUILDERS) + + +@pytest.mark.parametrize("case_name", sorted(_ALL)) +def test_asset_serializes(case_name): + """The asset rest object must serialize to wire without raising.""" + entity = _ALL[case_name]() + assert_serializes(entity._to_rest_object()) + + +@pytest.mark.parametrize("case_name", sorted(_ALL)) +def test_asset_wire_matches_expected(case_name): + """The asset wire must be byte-identical to the baseline captured from main.""" + entity = _ALL[case_name]() + assert_wire_matches_expected(case_name, entity._to_rest_object()) diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_automl_wire.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_automl_wire.py new file mode 100644 index 000000000000..9301271b1788 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_automl_wire.py @@ -0,0 +1,22 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Wire-serialization smoke tests for AutoML job entities.""" +import pytest + +from _builders_automl import AUTOML_BUILDERS +from _wire import assert_wire_matches_expected, assert_serializes + + +@pytest.mark.parametrize("case_name", sorted(AUTOML_BUILDERS)) +def test_automl_serializes(case_name): + """The AutoML rest object must serialize to wire without raising.""" + entity = AUTOML_BUILDERS[case_name]() + assert_serializes(entity._to_rest_object()) + + +@pytest.mark.parametrize("case_name", sorted(AUTOML_BUILDERS)) +def test_automl_wire_matches_expected(case_name): + """The AutoML wire must be byte-identical to the baseline captured from main.""" + entity = AUTOML_BUILDERS[case_name]() + assert_wire_matches_expected(case_name, entity._to_rest_object()) diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_component_wire.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_component_wire.py new file mode 100644 index 000000000000..f8f13b9c7715 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_component_wire.py @@ -0,0 +1,26 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Wire-serialization smoke tests for component entities (Command, Spark).""" +import pytest + +from _builders_component import COMMAND_COMPONENT_BUILDERS, SPARK_COMPONENT_BUILDERS +from _wire import assert_wire_matches_expected, assert_serializes + +_ALL = {} +_ALL.update(COMMAND_COMPONENT_BUILDERS) +_ALL.update(SPARK_COMPONENT_BUILDERS) + + +@pytest.mark.parametrize("case_name", sorted(_ALL)) +def test_component_serializes(case_name): + """The component rest object must serialize to wire without raising.""" + entity = _ALL[case_name]() + assert_serializes(entity._to_rest_object()) + + +@pytest.mark.parametrize("case_name", sorted(_ALL)) +def test_component_wire_matches_expected(case_name): + """The component wire must be byte-identical to the baseline captured from main.""" + entity = _ALL[case_name]() + assert_wire_matches_expected(case_name, entity._to_rest_object()) diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_compute_wire.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_compute_wire.py new file mode 100644 index 000000000000..293c18d5f96c --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_compute_wire.py @@ -0,0 +1,25 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Wire-serialization smoke tests for compute entities. + +See ``test_command_job_wire.py`` for the two-check pattern (serialization guard + wire equivalence). +""" +import pytest + +from _builders_compute import COMPUTE_BUILDERS +from _wire import assert_wire_matches_expected, assert_serializes + + +@pytest.mark.parametrize("case_name", sorted(COMPUTE_BUILDERS)) +def test_compute_serializes(case_name): + """The compute rest object must serialize to wire without raising.""" + entity = COMPUTE_BUILDERS[case_name]() + assert_serializes(entity._to_rest_object()) + + +@pytest.mark.parametrize("case_name", sorted(COMPUTE_BUILDERS)) +def test_compute_wire_matches_expected(case_name): + """The compute wire must be byte-identical to the baseline captured from main.""" + entity = COMPUTE_BUILDERS[case_name]() + assert_wire_matches_expected(case_name, entity._to_rest_object()) diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_datastore_wire.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_datastore_wire.py new file mode 100644 index 000000000000..5e097e0f0d59 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_datastore_wire.py @@ -0,0 +1,25 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Wire-serialization smoke tests for datastore entities. + +See ``test_command_job_wire.py`` for the two-check pattern (serialization guard + wire equivalence). +""" +import pytest + +from _builders_datastore import DATASTORE_BUILDERS +from _wire import assert_wire_matches_expected, assert_serializes + + +@pytest.mark.parametrize("case_name", sorted(DATASTORE_BUILDERS)) +def test_datastore_serializes(case_name): + """The datastore rest object must serialize to wire without raising.""" + entity = DATASTORE_BUILDERS[case_name]() + assert_serializes(entity._to_rest_object()) + + +@pytest.mark.parametrize("case_name", sorted(DATASTORE_BUILDERS)) +def test_datastore_wire_matches_expected(case_name): + """The datastore wire must be byte-identical to the baseline captured from main.""" + entity = DATASTORE_BUILDERS[case_name]() + assert_wire_matches_expected(case_name, entity._to_rest_object()) diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_endpoint_wire.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_endpoint_wire.py new file mode 100644 index 000000000000..8c6a90f762b8 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_endpoint_wire.py @@ -0,0 +1,29 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Wire-serialization smoke tests for online/batch endpoint + deployment entities. + +See ``test_command_job_wire.py`` for the two-check pattern (serialization guard + wire equivalence). +""" +import pytest + +from _builders_endpoint import BATCH_ENDPOINT_BUILDERS, ONLINE_ENDPOINT_BUILDERS +from _wire import assert_wire_matches_expected, assert_serializes + +_ALL = {} +_ALL.update(ONLINE_ENDPOINT_BUILDERS) +_ALL.update(BATCH_ENDPOINT_BUILDERS) + + +@pytest.mark.parametrize("case_name", sorted(_ALL)) +def test_endpoint_serializes(case_name): + """The endpoint/deployment rest object must serialize to wire without raising.""" + entity = _ALL[case_name]() + assert_serializes(entity._to_rest_object()) + + +@pytest.mark.parametrize("case_name", sorted(_ALL)) +def test_endpoint_wire_matches_expected(case_name): + """The endpoint/deployment wire must be byte-identical to the baseline captured from main.""" + entity = _ALL[case_name]() + assert_wire_matches_expected(case_name, entity._to_rest_object()) diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_featurestore_wire.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_featurestore_wire.py new file mode 100644 index 000000000000..c6b22832f100 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_featurestore_wire.py @@ -0,0 +1,31 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Wire-serialization smoke tests for feature-store + data-import entities.""" +import pytest + +from _builders_featurestore import ( + DATA_IMPORT_BUILDERS, + FEATURE_SET_BUILDERS, + FEATURE_STORE_ENTITY_BUILDERS, +) +from _wire import assert_wire_matches_expected, assert_serializes + +_ALL = {} +_ALL.update(FEATURE_SET_BUILDERS) +_ALL.update(FEATURE_STORE_ENTITY_BUILDERS) +_ALL.update(DATA_IMPORT_BUILDERS) + + +@pytest.mark.parametrize("case_name", sorted(_ALL)) +def test_featurestore_serializes(case_name): + """The feature-store/data-import rest object must serialize to wire without raising.""" + entity = _ALL[case_name]() + assert_serializes(entity._to_rest_object()) + + +@pytest.mark.parametrize("case_name", sorted(_ALL)) +def test_featurestore_wire_matches_expected(case_name): + """The feature-store/data-import wire must be byte-identical to the baseline from main.""" + entity = _ALL[case_name]() + assert_wire_matches_expected(case_name, entity._to_rest_object()) diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_monitoring_wire.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_monitoring_wire.py new file mode 100644 index 000000000000..d18e10b60d1f --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_monitoring_wire.py @@ -0,0 +1,25 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Wire-serialization smoke tests for monitoring (MonitorSchedule) entities.""" +import pytest + +from _builders_monitoring import MONITORING_BUILDERS +from _wire import assert_wire_matches_expected, assert_serializes + +_ALL = {} +_ALL.update(MONITORING_BUILDERS) + + +@pytest.mark.parametrize("case_name", sorted(_ALL)) +def test_monitoring_serializes(case_name): + """The monitoring rest object must serialize to wire without raising.""" + entity = _ALL[case_name]() + assert_serializes(entity._to_rest_object()) + + +@pytest.mark.parametrize("case_name", sorted(_ALL)) +def test_monitoring_wire_matches_expected(case_name): + """The monitoring wire must be byte-identical to the captured pre-migration baseline.""" + entity = _ALL[case_name]() + assert_wire_matches_expected(case_name, entity._to_rest_object()) diff --git a/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_workspace_wire.py b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_workspace_wire.py new file mode 100644 index 000000000000..6900a41b5492 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/smoke_serialization/test_workspace_wire.py @@ -0,0 +1,26 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +"""Wire-serialization smoke tests for workspace / registry entities.""" +import pytest + +from _builders_workspace import REGISTRY_BUILDERS, WORKSPACE_BUILDERS +from _wire import assert_wire_matches_expected, assert_serializes + +_ALL = {} +_ALL.update(WORKSPACE_BUILDERS) +_ALL.update(REGISTRY_BUILDERS) + + +@pytest.mark.parametrize("case_name", sorted(_ALL)) +def test_workspace_serializes(case_name): + """The workspace/registry/connection rest object must serialize to wire without raising.""" + entity = _ALL[case_name]() + assert_serializes(entity._to_rest_object()) + + +@pytest.mark.parametrize("case_name", sorted(_ALL)) +def test_workspace_wire_matches_expected(case_name): + """The workspace/registry/connection wire must be byte-identical to the baseline from main.""" + entity = _ALL[case_name]() + assert_wire_matches_expected(case_name, entity._to_rest_object()) diff --git a/sdk/ml/azure-ai-ml/tests/test_configs/monitoring/rest_json_configs/feature_attribution_drift_rest.json b/sdk/ml/azure-ai-ml/tests/test_configs/monitoring/rest_json_configs/feature_attribution_drift_rest.json index 72992250ef1d..7d234a886d5e 100644 --- a/sdk/ml/azure-ai-ml/tests/test_configs/monitoring/rest_json_configs/feature_attribution_drift_rest.json +++ b/sdk/ml/azure-ai-ml/tests/test_configs/monitoring/rest_json_configs/feature_attribution_drift_rest.json @@ -19,7 +19,6 @@ "testSignal": { "signalType": "FeatureAttributionDrift", "mode": "Enabled", - "modelType": "classification", "productionData": [ { "inputDataType": "Trailing", diff --git a/sdk/ml/azure-ai-ml/tests/test_configs/monitoring/rest_json_configs/generation_token_statistics_rest.json b/sdk/ml/azure-ai-ml/tests/test_configs/monitoring/rest_json_configs/generation_token_statistics_rest.json index 618ee7745593..5bc36ceb9f09 100644 --- a/sdk/ml/azure-ai-ml/tests/test_configs/monitoring/rest_json_configs/generation_token_statistics_rest.json +++ b/sdk/ml/azure-ai-ml/tests/test_configs/monitoring/rest_json_configs/generation_token_statistics_rest.json @@ -19,7 +19,7 @@ "testSignal": { "signalType": "GenerationTokenStatistics", "mode": "Enabled", - "samplingRate": "0.1", + "samplingRate": 0.1, "productionData": { "inputDataType": "Trailing",