From 0fa4a6d1d35892df80639268bb92e7936f360645 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Fri, 23 Oct 2020 13:37:10 +0800 Subject: [PATCH 1/5] version,CHANGELOG,test --- .../CHANGELOG.md | 31 +- .../mgmt/machinelearningservices/__init__.py | 18 +- .../_azure_machine_learning_workspaces.py | 110 +- .../machinelearningservices/_configuration.py | 79 +- .../{version.py => _version.py} | 10 +- .../machinelearningservices/aio/__init__.py | 10 + .../aio/_azure_machine_learning_workspaces.py | 115 + .../aio/_configuration.py | 67 + .../aio/operations/__init__.py | 35 + ..._machine_learning_workspaces_operations.py | 89 + .../_machine_learning_compute_operations.py | 879 +++++ .../aio/operations/_notebooks_operations.py | 154 + .../aio/operations/_operations.py | 105 + ...private_endpoint_connections_operations.py | 295 ++ .../_private_link_resources_operations.py | 99 + .../aio/operations/_quotas_operations.py | 177 + .../aio/operations/_usages_operations.py | 113 + .../_virtual_machine_sizes_operations.py | 105 + .../_workspace_connections_operations.py | 321 ++ .../_workspace_features_operations.py | 117 + .../aio/operations/_workspaces_operations.py | 662 ++++ .../models/__init__.py | 319 +- ...azure_machine_learning_workspaces_enums.py | 273 +- .../machinelearningservices/models/_models.py | 2903 +++++++++++---- .../models/_models_py3.py | 3099 ++++++++++++++--- .../models/_paged_models.py | 66 - .../operations/__init__.py | 21 +- ..._machine_learning_workspaces_operations.py | 94 + .../_machine_learning_compute_operations.py | 1089 +++--- .../operations/_notebooks_operations.py | 160 + .../operations/_operations.py | 123 +- ...private_endpoint_connections_operations.py | 303 ++ .../_private_link_resources_operations.py | 104 + .../operations/_quotas_operations.py | 183 + .../operations/_usages_operations.py | 128 +- .../_virtual_machine_sizes_operations.py | 114 +- .../_workspace_connections_operations.py | 329 ++ .../_workspace_features_operations.py | 122 + .../operations/_workspaces_operations.py | 827 +++-- .../mgmt/machinelearningservices/py.typed | 1 + .../test_mgmt_machinelearningservices.py | 29 + .../setup.py | 2 +- 42 files changed, 11513 insertions(+), 2367 deletions(-) rename sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/{version.py => _version.py} (84%) create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/__init__.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/_azure_machine_learning_workspaces.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/_configuration.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/__init__.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_azure_machine_learning_workspaces_operations.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_machine_learning_compute_operations.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_notebooks_operations.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_operations.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_private_link_resources_operations.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_quotas_operations.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_usages_operations.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_virtual_machine_sizes_operations.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_workspace_connections_operations.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_workspace_features_operations.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_workspaces_operations.py delete mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_paged_models.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_azure_machine_learning_workspaces_operations.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_notebooks_operations.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_private_link_resources_operations.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_quotas_operations.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspace_connections_operations.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspace_features_operations.py create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/py.typed create mode 100644 sdk/machinelearning/azure-mgmt-machinelearningservices/azure/tests/test_mgmt_machinelearningservices.py diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/CHANGELOG.md b/sdk/machinelearning/azure-mgmt-machinelearningservices/CHANGELOG.md index 5e6491fa17ce..bc02b5dffa2f 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/CHANGELOG.md +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/CHANGELOG.md @@ -1,6 +1,35 @@ # Release History -## 0.1.0 (Unreleased) +## 1.0.0b1 (2020-10-31) + +This is beta preview version. +For detailed changelog please refer to equivalent stable version 3.0.0 (https://pypi.org/project/azure-mgmt-machinelearningservices/0.1.0/) + +This version uses a next-generation code generator that introduces important breaking changes, but also important new features (like unified authentication and async programming). + +**General breaking changes** + +- Credential system has been completly revamped: + + - `azure.common.credentials` or `msrestazure.azure_active_directory` instances are no longer supported, use the `azure-identity` classes instead: https://pypi.org/project/azure-identity/ + - `credentials` parameter has been renamed `credential` + +- The `config` attribute no longer exists on a client, configuration should be passed as kwarg. Example: `MyClient(credential, subscription_id, enable_logging=True)`. For a complete set of + supported options, see the [parameters accept in init documentation of azure-core](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies) +- You can't import a `version` module anymore, use `__version__` instead +- Operations that used to return a `msrest.polling.LROPoller` now returns a `azure.core.polling.LROPoller` and are prefixed with `begin_`. +- Exceptions tree have been simplified and most exceptions are now `azure.core.exceptions.HttpResponseError` (`CloudError` has been removed). +- Most of the operation kwarg have changed. Some of the most noticeable: + + - `raw` has been removed. Equivalent feature can be found using `cls`, a callback that will give access to internal HTTP response for advanced user + - For a complete set of supported options, see the [parameters accept in Request documentation of azure-core](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies) + +**General new features** + +- Type annotations support using `typing`. SDKs are mypy ready. +- This client has now stable and official support for async. Check the `aio` namespace of your package to find the async client. +- This client now support natively tracing library like OpenCensus or OpenTelemetry. See this [tracing quickstart](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/core/azure-core-tracing-opentelemetry) for an overview. + ## 0.4.1 (2018-05-29) diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/__init__.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/__init__.py index 02d8756a81eb..67feb9a70351 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/__init__.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/__init__.py @@ -1,19 +1,19 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration import AzureMachineLearningWorkspacesConfiguration from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces', 'AzureMachineLearningWorkspacesConfiguration'] - -from .version import VERSION +from ._version import VERSION __version__ = VERSION +__all__ = ['AzureMachineLearningWorkspaces'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/_azure_machine_learning_workspaces.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/_azure_machine_learning_workspaces.py index e0a0e2c4d834..527b9e2bb787 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/_azure_machine_learning_workspaces.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/_azure_machine_learning_workspaces.py @@ -1,69 +1,121 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential from ._configuration import AzureMachineLearningWorkspacesConfiguration from .operations import Operations from .operations import WorkspacesOperations +from .operations import WorkspaceFeaturesOperations +from .operations import NotebooksOperations from .operations import UsagesOperations from .operations import VirtualMachineSizesOperations +from .operations import QuotasOperations +from .operations import WorkspaceConnectionsOperations from .operations import MachineLearningComputeOperations +from .operations import AzureMachineLearningWorkspacesOperationsMixin +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations from . import models -class AzureMachineLearningWorkspaces(SDKClient): +class AzureMachineLearningWorkspaces(AzureMachineLearningWorkspacesOperationsMixin): """These APIs allow end users to operate on Azure Machine Learning Workspace resources. - :ivar config: Configuration for client. - :vartype config: AzureMachineLearningWorkspacesConfiguration - :ivar operations: Operations operations :vartype operations: azure.mgmt.machinelearningservices.operations.Operations - :ivar workspaces: Workspaces operations + :ivar workspaces: WorkspacesOperations operations :vartype workspaces: azure.mgmt.machinelearningservices.operations.WorkspacesOperations - :ivar usages: Usages operations + :ivar workspace_features: WorkspaceFeaturesOperations operations + :vartype workspace_features: azure.mgmt.machinelearningservices.operations.WorkspaceFeaturesOperations + :ivar notebooks: NotebooksOperations operations + :vartype notebooks: azure.mgmt.machinelearningservices.operations.NotebooksOperations + :ivar usages: UsagesOperations operations :vartype usages: azure.mgmt.machinelearningservices.operations.UsagesOperations - :ivar virtual_machine_sizes: VirtualMachineSizes operations + :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations :vartype virtual_machine_sizes: azure.mgmt.machinelearningservices.operations.VirtualMachineSizesOperations - :ivar machine_learning_compute: MachineLearningCompute operations + :ivar quotas: QuotasOperations operations + :vartype quotas: azure.mgmt.machinelearningservices.operations.QuotasOperations + :ivar workspace_connections: WorkspaceConnectionsOperations operations + :vartype workspace_connections: azure.mgmt.machinelearningservices.operations.WorkspaceConnectionsOperations + :ivar machine_learning_compute: MachineLearningComputeOperations operations :vartype machine_learning_compute: azure.mgmt.machinelearningservices.operations.MachineLearningComputeOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` + :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 + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: Azure subscription identifier. :type subscription_id: str :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = AzureMachineLearningWorkspacesConfiguration(credentials, subscription_id, base_url) - super(AzureMachineLearningWorkspaces, self).__init__(self.config.credentials, self.config) + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = AzureMachineLearningWorkspacesConfiguration(credential, 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.api_version = '2019-05-01' self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.workspaces = WorkspacesOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) + self.workspace_features = WorkspaceFeaturesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.notebooks = NotebooksOperations( + self._client, self._config, self._serialize, self._deserialize) self.usages = UsagesOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.virtual_machine_sizes = VirtualMachineSizesOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) + self.quotas = QuotasOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workspace_connections = WorkspaceConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) self.machine_learning_compute = MachineLearningComputeOperations( - self._client, self.config, self._serialize, self._deserialize) + 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) + + 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/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/_configuration.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/_configuration.py index 06a054e13cdb..79ded5841781 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/_configuration.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/_configuration.py @@ -1,48 +1,71 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration -from .version import VERSION +from typing import TYPE_CHECKING +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class AzureMachineLearningWorkspacesConfiguration(Configuration): + """Configuration for AzureMachineLearningWorkspaces. -class AzureMachineLearningWorkspacesConfiguration(AzureConfiguration): - """Configuration for AzureMachineLearningWorkspaces Note that all parameters used to create this instance are saved as instance attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: Azure subscription identifier. :type subscription_id: str - :param str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + 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.") - if not base_url: - base_url = 'https://management.azure.com' - - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True + super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - self.add_user_agent('azure-mgmt-machinelearningservices/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials + self.credential = credential self.subscription_id = subscription_id + self.api_version = "2020-08-01" + 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 = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/version.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/_version.py similarity index 84% rename from sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/version.py rename to sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/_version.py index e0ec669828cb..e5754a47ce68 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/version.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/_version.py @@ -1,13 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" - +VERSION = "1.0.0b1" diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/__init__.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/__init__.py new file mode 100644 index 000000000000..872474577c4f --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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'] diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/_azure_machine_learning_workspaces.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/_azure_machine_learning_workspaces.py new file mode 100644 index 000000000000..77636808b2d6 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/_azure_machine_learning_workspaces.py @@ -0,0 +1,115 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import AzureMachineLearningWorkspacesConfiguration +from .operations import Operations +from .operations import WorkspacesOperations +from .operations import WorkspaceFeaturesOperations +from .operations import NotebooksOperations +from .operations import UsagesOperations +from .operations import VirtualMachineSizesOperations +from .operations import QuotasOperations +from .operations import WorkspaceConnectionsOperations +from .operations import MachineLearningComputeOperations +from .operations import AzureMachineLearningWorkspacesOperationsMixin +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations +from .. import models + + +class AzureMachineLearningWorkspaces(AzureMachineLearningWorkspacesOperationsMixin): + """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 workspace_features: WorkspaceFeaturesOperations operations + :vartype workspace_features: azure.mgmt.machinelearningservices.aio.operations.WorkspaceFeaturesOperations + :ivar notebooks: NotebooksOperations operations + :vartype notebooks: azure.mgmt.machinelearningservices.aio.operations.NotebooksOperations + :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 workspace_connections: WorkspaceConnectionsOperations operations + :vartype workspace_connections: azure.mgmt.machinelearningservices.aio.operations.WorkspaceConnectionsOperations + :ivar machine_learning_compute: MachineLearningComputeOperations operations + :vartype machine_learning_compute: azure.mgmt.machinelearningservices.aio.operations.MachineLearningComputeOperations + :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 + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Azure subscription identifier. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = AzureMachineLearningWorkspacesConfiguration(credential, 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._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.workspaces = WorkspacesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workspace_features = WorkspaceFeaturesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.notebooks = NotebooksOperations( + 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.workspace_connections = WorkspaceConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.machine_learning_compute = MachineLearningComputeOperations( + 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) + + 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/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/_configuration.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/_configuration.py new file mode 100644 index 000000000000..a11cb071c326 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/_configuration.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated 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 + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class AzureMachineLearningWorkspacesConfiguration(Configuration): + """Configuration for AzureMachineLearningWorkspaces. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Azure subscription identifier. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + 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.") + super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-08-01" + 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 = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/__init__.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/__init__.py new file mode 100644 index 000000000000..516999b100d8 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/__init__.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ._workspace_features_operations import WorkspaceFeaturesOperations +from ._notebooks_operations import NotebooksOperations +from ._usages_operations import UsagesOperations +from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations +from ._quotas_operations import QuotasOperations +from ._workspace_connections_operations import WorkspaceConnectionsOperations +from ._machine_learning_compute_operations import MachineLearningComputeOperations +from ._azure_machine_learning_workspaces_operations import AzureMachineLearningWorkspacesOperationsMixin +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations + +__all__ = [ + 'Operations', + 'WorkspacesOperations', + 'WorkspaceFeaturesOperations', + 'NotebooksOperations', + 'UsagesOperations', + 'VirtualMachineSizesOperations', + 'QuotasOperations', + 'WorkspaceConnectionsOperations', + 'MachineLearningComputeOperations', + 'AzureMachineLearningWorkspacesOperationsMixin', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', +] diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_azure_machine_learning_workspaces_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_azure_machine_learning_workspaces_operations.py new file mode 100644 index 000000000000..67617c484073 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_azure_machine_learning_workspaces_operations.py @@ -0,0 +1,89 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AzureMachineLearningWorkspacesOperationsMixin: + + def list_skus( + self, + **kwargs + ) -> AsyncIterable["models.SkuListResult"]: + """Lists all skus with associated features. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SkuListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SkuListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces/skus'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_machine_learning_compute_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_machine_learning_compute_operations.py new file mode 100644 index 000000000000..63dd783c9605 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_machine_learning_compute_operations.py @@ -0,0 +1,879 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class MachineLearningComputeOperations: + """MachineLearningComputeOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.machinelearningservices.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_workspace( + self, + resource_group_name: str, + workspace_name: str, + skiptoken: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.PaginatedComputeResourcesList"]: + """Gets computes in specified workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :type resource_group_name: str + :param workspace_name: Name of Azure Machine Learning workspace. + :type workspace_name: str + :param skiptoken: Continuation token for pagination. + :type skiptoken: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PaginatedComputeResourcesList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PaginatedComputeResourcesList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_workspace.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PaginatedComputeResourcesList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes'} # type: ignore + + async def get( + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + **kwargs + ) -> "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: Name of the resource group in which workspace is located. + :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 = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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 + ) -> "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 = "2020-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ComputeResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + parameters: "models.ComputeResource", + **kwargs + ) -> 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: Name of the resource group in which workspace is located. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: 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: + """ + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + deserialized = self._deserialize('ComputeResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + scale_settings: Optional["models.ScaleSettings"] = None, + **kwargs + ) -> "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', {})) + + _parameters = models.ClusterUpdateParameters(scale_settings=scale_settings) + api_version = "2020-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ClusterUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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 + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + scale_settings: Optional["models.ScaleSettings"] = None, + **kwargs + ) -> 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: Name of the resource group in which workspace is located. + :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 scale_settings: Desired scale settings for the amlCompute. + :type scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: 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: + """ + 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, + scale_settings=scale_settings, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ComputeResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + underlying_resource_action: Union[str, "models.UnderlyingResourceAction"], + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['underlyingResourceAction'] = self._serialize.query("underlying_resource_action", underlying_resource_action, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + 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 + + async def begin_delete( + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + underlying_resource_action: Union[str, "models.UnderlyingResourceAction"], + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes specified Machine Learning compute. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + compute_name=compute_name, + underlying_resource_action=underlying_resource_action, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + + async def list_nodes( + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + **kwargs + ) -> "models.AmlComputeNodesInformation": + """Get the details (e.g IP address, port etc) of all the compute nodes in the compute. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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: AmlComputeNodesInformation, or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AmlComputeNodesInformation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self.list_nodes.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AmlComputeNodesInformation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_nodes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes'} # type: ignore + + async def list_keys( + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + **kwargs + ) -> "models.ComputeSecrets": + """Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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( + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + **kwargs + ) -> None: + """Posts a start action to a compute instance. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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: 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 = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self.start.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} # type: ignore + + async def stop( + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + **kwargs + ) -> None: + """Posts a stop action to a compute instance. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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: 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 = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self.stop.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} # type: ignore + + async def restart( + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + **kwargs + ) -> None: + """Posts a restart action to a compute instance. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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: 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 = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self.restart.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_notebooks_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_notebooks_operations.py new file mode 100644 index 000000000000..909713917cef --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_notebooks_operations.py @@ -0,0 +1,154 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated 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, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NotebooksOperations: + """NotebooksOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.machinelearningservices.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object 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 _prepare_initial( + self, + resource_group_name: str, + workspace_name: str, + **kwargs + ) -> 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 = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self._prepare_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, 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_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore + + async def begin_prepare( + self, + resource_group_name: str, + workspace_name: str, + **kwargs + ) -> AsyncLROPoller["models.NotebookResourceInfo"]: + """prepare. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either NotebookResourceInfo or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, 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_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_prepare.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_operations.py new file mode 100644 index 000000000000..fc2e1a0ca5df --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +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 + + def list( + self, + **kwargs + ) -> AsyncIterable["models.OperationListResult"]: + """Lists all of the available Azure Machine Learning Workspaces REST API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_private_endpoint_connections_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..d0b59154926a --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,295 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated 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, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +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 + + async def get( + self, + resource_group_name: str, + workspace_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> "models.PrivateEndpointConnection": + """Gets the specified private endpoint connection associated with the workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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 + + async def put( + self, + resource_group_name: str, + workspace_name: str, + private_endpoint_connection_name: str, + private_endpoint: Optional["models.PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["models.PrivateLinkServiceConnectionState"] = None, + **kwargs + ) -> "models.PrivateEndpointConnection": + """Update the state of specified private endpoint connection associated with the workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type private_link_service_connection_state: ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState + :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', {})) + + _properties = models.PrivateEndpointConnection(private_endpoint=private_endpoint, private_link_service_connection_state=private_link_service_connection_state) + api_version = "2020-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.put.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_properties, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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 + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + workspace_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + workspace_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified private endpoint connection associated with the workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, 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, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_private_link_resources_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..1157656c99d6 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_private_link_resources_operations.py @@ -0,0 +1,99 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated 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, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +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 + + async def list_by_workspace( + self, + resource_group_name: str, + workspace_name: str, + **kwargs + ) -> "models.PrivateLinkResourceListResult": + """Gets the private link resources that need to be created for a workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self.list_by_workspace.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_quotas_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_quotas_operations.py new file mode 100644 index 000000000000..d98f2474de2d --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_quotas_operations.py @@ -0,0 +1,177 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +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 + + async def update( + self, + location: str, + value: Optional[List["models.QuotaBaseProperties"]] = None, + **kwargs + ) -> "models.UpdateWorkspaceQuotasResult": + """Update quota for each VM family in workspace. + + :param location: The location for update quota is queried. + :type location: str + :param value: The list for update quota. + :type value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] + :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', {})) + + _parameters = models.QuotaUpdateParameters(value=value) + api_version = "2020-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'QuotaUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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 + + def list( + self, + location: str, + **kwargs + ) -> AsyncIterable["models.ListWorkspaceQuotas"]: + """Gets the currently assigned Workspace Quotas based on VMFamily. + + :param location: The location for which resource usage is queried. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListWorkspaceQuotas or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListWorkspaceQuotas"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListWorkspaceQuotas', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/Quotas'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_usages_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_usages_operations.py new file mode 100644 index 000000000000..29d48640d615 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_usages_operations.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +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 + + def list( + self, + location: str, + **kwargs + ) -> AsyncIterable["models.ListUsagesResult"]: + """Gets the current usage information as well as limits for AML resources for given subscription + and location. + + :param location: The location for which resource usage is queried. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListUsagesResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListUsagesResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_virtual_machine_sizes_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_virtual_machine_sizes_operations.py new file mode 100644 index 000000000000..486b2bde6c43 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_virtual_machine_sizes_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated 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, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +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 + + async def list( + self, + location: str, + compute_type: Optional[str] = None, + recommended: Optional[bool] = None, + **kwargs + ) -> "models.VirtualMachineSizeListResult": + """Returns supported VM Sizes in a location. + + :param location: The location upon which virtual-machine-sizes is queried. + :type location: str + :param compute_type: Type of compute to filter by. + :type compute_type: str + :param recommended: Specifies whether to return recommended vm sizes or all vm sizes. + :type recommended: bool + :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 = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if compute_type is not None: + query_parameters['compute-type'] = self._serialize.query("compute_type", compute_type, 'str') + if recommended is not None: + query_parameters['recommended'] = self._serialize.query("recommended", recommended, 'bool') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_workspace_connections_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_workspace_connections_operations.py new file mode 100644 index 000000000000..6ecae477acd7 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_workspace_connections_operations.py @@ -0,0 +1,321 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +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 + + def list( + self, + resource_group_name: str, + workspace_name: str, + target: Optional[str] = None, + category: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.PaginatedWorkspaceConnectionsList"]: + """List all connections under a AML workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 PaginatedWorkspaceConnectionsList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedWorkspaceConnectionsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PaginatedWorkspaceConnectionsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if target is not None: + query_parameters['target'] = self._serialize.query("target", target, 'str') + if category is not None: + query_parameters['category'] = self._serialize.query("category", category, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PaginatedWorkspaceConnectionsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, 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 + + async def create( + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + parameters: "models.WorkspaceConnectionDto", + **kwargs + ) -> "models.WorkspaceConnection": + """Add a new workspace connection. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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.WorkspaceConnectionDto + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkspaceConnection, or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkspaceConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'WorkspaceConnectionDto') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WorkspaceConnection', 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 + + async def get( + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + **kwargs + ) -> "models.WorkspaceConnection": + """Get the detail of a workspace connection. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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: WorkspaceConnection, or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkspaceConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WorkspaceConnection', 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 + + async def delete( + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + **kwargs + ) -> None: + """Delete a workspace connection. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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 diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_workspace_features_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_workspace_features_operations.py new file mode 100644 index 000000000000..c7a4cc03f300 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_workspace_features_operations.py @@ -0,0 +1,117 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +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 + + def list( + self, + resource_group_name: str, + workspace_name: str, + **kwargs + ) -> AsyncIterable["models.ListAmlUserFeatureResult"]: + """Lists all enabled features for a workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :type resource_group_name: str + :param workspace_name: Name of Azure Machine Learning workspace. + :type workspace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListAmlUserFeatureResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListAmlUserFeatureResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListAmlUserFeatureResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, 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/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_workspaces_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_workspaces_operations.py new file mode 100644 index 000000000000..02e5d40849c3 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/aio/operations/_workspaces_operations.py @@ -0,0 +1,662 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +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 + + async def get( + self, + resource_group_name: str, + workspace_name: str, + **kwargs + ) -> "models.Workspace": + """Gets the properties of the specified machine learning workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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 + ) -> 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 = "2020-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Workspace') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(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) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Workspace', pipeline_response) + + if response.status_code == 201: + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + workspace_name: str, + parameters: "models.Workspace", + **kwargs + ) -> AsyncLROPoller["models.Workspace"]: + """Creates or updates a workspace with the specified parameters. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: 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: + """ + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Workspace', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + workspace_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, 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 + + async def begin_delete( + self, + resource_group_name: str, + workspace_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a machine learning workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + workspace_name: str, + parameters: "models.WorkspaceUpdateParameters", + **kwargs + ) -> "models.Workspace": + """Updates a machine learning workspace with the specified parameters. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 + :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 = "2020-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'WorkspaceUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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 + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + skiptoken: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.WorkspaceListResult"]: + """Lists all the available machine learning workspaces under the specified resource group. + + :param resource_group_name: Name of the resource group in which workspace is located. + :type resource_group_name: str + :param skiptoken: Continuation token for pagination. + :type skiptoken: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkspaceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkspaceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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 list_keys( + self, + resource_group_name: str, + workspace_name: str, + **kwargs + ) -> "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: Name of the resource group in which workspace is located. + :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 = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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( + self, + resource_group_name: str, + workspace_name: str, + **kwargs + ) -> 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: Name of the resource group in which workspace is located. + :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: 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 = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self.resync_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + resync_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} # type: ignore + + def list_by_subscription( + self, + skiptoken: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.WorkspaceListResult"]: + """Lists all the available machine learning workspaces under the specified subscription. + + :param skiptoken: Continuation token for pagination. + :type skiptoken: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkspaceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkspaceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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 diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/__init__.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/__init__.py index 2a709812fa94..05c48b7f14c0 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/__init__.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/__init__.py @@ -1,52 +1,90 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- try: from ._models_py3 import AKS + from ._models_py3 import AKSProperties from ._models_py3 import AksComputeSecrets from ._models_py3 import AksNetworkingConfiguration - from ._models_py3 import AKSProperties from ._models_py3 import AmlCompute from ._models_py3 import AmlComputeNodeInformation from ._models_py3 import AmlComputeNodesInformation from ._models_py3 import AmlComputeProperties + from ._models_py3 import AmlUserFeature from ._models_py3 import ClusterUpdateParameters + from ._models_py3 import ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties from ._models_py3 import Compute + from ._models_py3 import ComputeInstance + from ._models_py3 import ComputeInstanceApplication + from ._models_py3 import ComputeInstanceConnectivityEndpoints + from ._models_py3 import ComputeInstanceCreatedBy + from ._models_py3 import ComputeInstanceLastOperation + from ._models_py3 import ComputeInstanceProperties + from ._models_py3 import ComputeInstanceSshSettings from ._models_py3 import ComputeNodesInformation from ._models_py3 import ComputeResource from ._models_py3 import ComputeSecrets - from ._models_py3 import Databricks - from ._models_py3 import DatabricksComputeSecrets - from ._models_py3 import DatabricksProperties from ._models_py3 import DataFactory from ._models_py3 import DataLakeAnalytics from ._models_py3 import DataLakeAnalyticsProperties + from ._models_py3 import Databricks + from ._models_py3 import DatabricksComputeSecrets + from ._models_py3 import DatabricksProperties + from ._models_py3 import EncryptionProperty from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse + from ._models_py3 import EstimatedVMPrice + from ._models_py3 import EstimatedVMPrices from ._models_py3 import HDInsight from ._models_py3 import HDInsightProperties from ._models_py3 import Identity + from ._models_py3 import KeyVaultProperties + from ._models_py3 import ListAmlUserFeatureResult + from ._models_py3 import ListUsagesResult from ._models_py3 import ListWorkspaceKeysResult - from ._models_py3 import MachineLearningServiceError, MachineLearningServiceErrorException + from ._models_py3 import ListWorkspaceQuotas + from ._models_py3 import MachineLearningServiceError from ._models_py3 import NodeStateCounts + from ._models_py3 import NotebookListCredentialsResult + from ._models_py3 import NotebookPreparationError + from ._models_py3 import NotebookResourceInfo from ._models_py3 import Operation from ._models_py3 import OperationDisplay + from ._models_py3 import OperationListResult + from ._models_py3 import PaginatedComputeResourcesList + from ._models_py3 import PaginatedWorkspaceConnectionsList from ._models_py3 import Password + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourceListResult + from ._models_py3 import PrivateLinkServiceConnectionState + from ._models_py3 import QuotaBaseProperties + from ._models_py3 import QuotaUpdateParameters from ._models_py3 import RegistryListCredentialsResult from ._models_py3 import Resource from ._models_py3 import ResourceId + from ._models_py3 import ResourceName + from ._models_py3 import ResourceQuota + from ._models_py3 import ResourceSkuLocationInfo + from ._models_py3 import ResourceSkuZoneDetails + from ._models_py3 import Restriction + from ._models_py3 import SKUCapability from ._models_py3 import ScaleSettings from ._models_py3 import ServicePrincipalCredentials + from ._models_py3 import SharedPrivateLinkResource + from ._models_py3 import Sku + from ._models_py3 import SkuListResult + from ._models_py3 import SkuSettings from ._models_py3 import SslConfiguration from ._models_py3 import SystemService + from ._models_py3 import UpdateWorkspaceQuotas + from ._models_py3 import UpdateWorkspaceQuotasResult from ._models_py3 import Usage from ._models_py3 import UsageName from ._models_py3 import UserAccountCredentials @@ -57,108 +95,213 @@ from ._models_py3 import VirtualMachineSizeListResult from ._models_py3 import VirtualMachineSshCredentials from ._models_py3 import Workspace + from ._models_py3 import WorkspaceConnection + from ._models_py3 import WorkspaceConnectionDto + from ._models_py3 import WorkspaceListResult + from ._models_py3 import WorkspaceSku from ._models_py3 import WorkspaceUpdateParameters except (SyntaxError, ImportError): - from ._models import AKS - from ._models import AksComputeSecrets - from ._models import AksNetworkingConfiguration - from ._models import AKSProperties - from ._models import AmlCompute - from ._models import AmlComputeNodeInformation - from ._models import AmlComputeNodesInformation - from ._models import AmlComputeProperties - from ._models import ClusterUpdateParameters - from ._models import Compute - from ._models import ComputeNodesInformation - from ._models import ComputeResource - from ._models import ComputeSecrets - from ._models import Databricks - from ._models import DatabricksComputeSecrets - from ._models import DatabricksProperties - from ._models import DataFactory - from ._models import DataLakeAnalytics - from ._models import DataLakeAnalyticsProperties - from ._models import ErrorDetail - from ._models import ErrorResponse - from ._models import HDInsight - from ._models import HDInsightProperties - from ._models import Identity - from ._models import ListWorkspaceKeysResult - from ._models import MachineLearningServiceError, MachineLearningServiceErrorException - from ._models import NodeStateCounts - from ._models import Operation - from ._models import OperationDisplay - from ._models import Password - from ._models import RegistryListCredentialsResult - from ._models import Resource - from ._models import ResourceId - from ._models import ScaleSettings - from ._models import ServicePrincipalCredentials - from ._models import SslConfiguration - from ._models import SystemService - from ._models import Usage - from ._models import UsageName - from ._models import UserAccountCredentials - from ._models import VirtualMachine - from ._models import VirtualMachineProperties - from ._models import VirtualMachineSecrets - from ._models import VirtualMachineSize - from ._models import VirtualMachineSizeListResult - from ._models import VirtualMachineSshCredentials - from ._models import Workspace - from ._models import WorkspaceUpdateParameters -from ._paged_models import ComputeResourcePaged -from ._paged_models import OperationPaged -from ._paged_models import UsagePaged -from ._paged_models import WorkspacePaged + from ._models import AKS # type: ignore + from ._models import AKSProperties # type: ignore + from ._models import AksComputeSecrets # type: ignore + from ._models import AksNetworkingConfiguration # type: ignore + from ._models import AmlCompute # type: ignore + from ._models import AmlComputeNodeInformation # type: ignore + from ._models import AmlComputeNodesInformation # type: ignore + from ._models import AmlComputeProperties # type: ignore + from ._models import AmlUserFeature # type: ignore + from ._models import ClusterUpdateParameters # type: ignore + from ._models import ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore + from ._models import Compute # type: ignore + from ._models import ComputeInstance # type: ignore + from ._models import ComputeInstanceApplication # type: ignore + from ._models import ComputeInstanceConnectivityEndpoints # type: ignore + from ._models import ComputeInstanceCreatedBy # type: ignore + from ._models import ComputeInstanceLastOperation # type: ignore + from ._models import ComputeInstanceProperties # type: ignore + from ._models import ComputeInstanceSshSettings # type: ignore + from ._models import ComputeNodesInformation # type: ignore + from ._models import ComputeResource # type: ignore + from ._models import ComputeSecrets # type: ignore + from ._models import DataFactory # type: ignore + from ._models import DataLakeAnalytics # type: ignore + from ._models import DataLakeAnalyticsProperties # type: ignore + from ._models import Databricks # type: ignore + from ._models import DatabricksComputeSecrets # type: ignore + from ._models import DatabricksProperties # type: ignore + from ._models import EncryptionProperty # 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 HDInsight # type: ignore + from ._models import HDInsightProperties # type: ignore + from ._models import Identity # type: ignore + from ._models import KeyVaultProperties # type: ignore + from ._models import ListAmlUserFeatureResult # type: ignore + from ._models import ListUsagesResult # type: ignore + from ._models import ListWorkspaceKeysResult # type: ignore + from ._models import ListWorkspaceQuotas # type: ignore + from ._models import MachineLearningServiceError # type: ignore + from ._models import NodeStateCounts # type: ignore + from ._models import NotebookListCredentialsResult # type: ignore + from ._models import NotebookPreparationError # type: ignore + from ._models import NotebookResourceInfo # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationListResult # type: ignore + from ._models import PaginatedComputeResourcesList # type: ignore + from ._models import PaginatedWorkspaceConnectionsList # type: ignore + from ._models import Password # type: ignore + from ._models import PrivateEndpoint # type: ignore + from ._models import PrivateEndpointConnection # type: ignore + from ._models import PrivateLinkResource # type: ignore + from ._models import PrivateLinkResourceListResult # type: ignore + from ._models import PrivateLinkServiceConnectionState # type: ignore + from ._models import QuotaBaseProperties # type: ignore + from ._models import QuotaUpdateParameters # type: ignore + from ._models import RegistryListCredentialsResult # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceId # type: ignore + from ._models import ResourceName # type: ignore + from ._models import ResourceQuota # type: ignore + from ._models import ResourceSkuLocationInfo # type: ignore + from ._models import ResourceSkuZoneDetails # type: ignore + from ._models import Restriction # type: ignore + from ._models import SKUCapability # type: ignore + from ._models import ScaleSettings # type: ignore + from ._models import ServicePrincipalCredentials # type: ignore + from ._models import SharedPrivateLinkResource # type: ignore + from ._models import Sku # type: ignore + from ._models import SkuListResult # type: ignore + from ._models import SkuSettings # type: ignore + from ._models import SslConfiguration # type: ignore + from ._models import SystemService # type: ignore + from ._models import UpdateWorkspaceQuotas # type: ignore + from ._models import UpdateWorkspaceQuotasResult # type: ignore + from ._models import Usage # type: ignore + from ._models import UsageName # type: ignore + from ._models import UserAccountCredentials # type: ignore + from ._models import VirtualMachine # type: ignore + from ._models import VirtualMachineProperties # type: ignore + from ._models import VirtualMachineSecrets # type: ignore + from ._models import VirtualMachineSize # type: ignore + from ._models import VirtualMachineSizeListResult # type: ignore + from ._models import VirtualMachineSshCredentials # type: ignore + from ._models import Workspace # type: ignore + from ._models import WorkspaceConnection # type: ignore + from ._models import WorkspaceConnectionDto # type: ignore + from ._models import WorkspaceListResult # type: ignore + from ._models import WorkspaceSku # type: ignore + from ._models import WorkspaceUpdateParameters # type: ignore + from ._azure_machine_learning_workspaces_enums import ( - ProvisioningState, - UsageUnit, - ResourceIdentityType, - VmPriority, AllocationState, + ApplicationSharingPolicy, + BillingCurrency, + ComputeInstanceState, ComputeType, + EncryptionStatus, + NodeState, + OperationName, + OperationStatus, + PrivateEndpointConnectionProvisioningState, + PrivateEndpointServiceConnectionStatus, + ProvisioningState, + QuotaUnit, + ReasonCode, + RemoteLoginPortPublicAccess, + ResourceIdentityType, + SshPublicAccess, + SslConfigurationStatus, + Status, UnderlyingResourceAction, + UnitOfMeasure, + UsageUnit, + VMPriceOSType, + VMTier, + VmPriority, ) __all__ = [ 'AKS', + 'AKSProperties', 'AksComputeSecrets', 'AksNetworkingConfiguration', - 'AKSProperties', 'AmlCompute', 'AmlComputeNodeInformation', 'AmlComputeNodesInformation', 'AmlComputeProperties', + 'AmlUserFeature', 'ClusterUpdateParameters', + 'ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties', 'Compute', + 'ComputeInstance', + 'ComputeInstanceApplication', + 'ComputeInstanceConnectivityEndpoints', + 'ComputeInstanceCreatedBy', + 'ComputeInstanceLastOperation', + 'ComputeInstanceProperties', + 'ComputeInstanceSshSettings', 'ComputeNodesInformation', 'ComputeResource', 'ComputeSecrets', - 'Databricks', - 'DatabricksComputeSecrets', - 'DatabricksProperties', 'DataFactory', 'DataLakeAnalytics', 'DataLakeAnalyticsProperties', + 'Databricks', + 'DatabricksComputeSecrets', + 'DatabricksProperties', + 'EncryptionProperty', 'ErrorDetail', 'ErrorResponse', + 'EstimatedVMPrice', + 'EstimatedVMPrices', 'HDInsight', 'HDInsightProperties', 'Identity', + 'KeyVaultProperties', + 'ListAmlUserFeatureResult', + 'ListUsagesResult', 'ListWorkspaceKeysResult', - 'MachineLearningServiceError', 'MachineLearningServiceErrorException', + 'ListWorkspaceQuotas', + 'MachineLearningServiceError', 'NodeStateCounts', + 'NotebookListCredentialsResult', + 'NotebookPreparationError', + 'NotebookResourceInfo', 'Operation', 'OperationDisplay', + 'OperationListResult', + 'PaginatedComputeResourcesList', + 'PaginatedWorkspaceConnectionsList', 'Password', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateLinkResource', + 'PrivateLinkResourceListResult', + 'PrivateLinkServiceConnectionState', + 'QuotaBaseProperties', + 'QuotaUpdateParameters', 'RegistryListCredentialsResult', 'Resource', 'ResourceId', + 'ResourceName', + 'ResourceQuota', + 'ResourceSkuLocationInfo', + 'ResourceSkuZoneDetails', + 'Restriction', + 'SKUCapability', 'ScaleSettings', 'ServicePrincipalCredentials', + 'SharedPrivateLinkResource', + 'Sku', + 'SkuListResult', + 'SkuSettings', 'SslConfiguration', 'SystemService', + 'UpdateWorkspaceQuotas', + 'UpdateWorkspaceQuotasResult', 'Usage', 'UsageName', 'UserAccountCredentials', @@ -169,16 +312,34 @@ 'VirtualMachineSizeListResult', 'VirtualMachineSshCredentials', 'Workspace', + 'WorkspaceConnection', + 'WorkspaceConnectionDto', + 'WorkspaceListResult', + 'WorkspaceSku', 'WorkspaceUpdateParameters', - 'OperationPaged', - 'WorkspacePaged', - 'UsagePaged', - 'ComputeResourcePaged', - 'ProvisioningState', - 'UsageUnit', - 'ResourceIdentityType', - 'VmPriority', 'AllocationState', + 'ApplicationSharingPolicy', + 'BillingCurrency', + 'ComputeInstanceState', 'ComputeType', + 'EncryptionStatus', + 'NodeState', + 'OperationName', + 'OperationStatus', + 'PrivateEndpointConnectionProvisioningState', + 'PrivateEndpointServiceConnectionStatus', + 'ProvisioningState', + 'QuotaUnit', + 'ReasonCode', + 'RemoteLoginPortPublicAccess', + 'ResourceIdentityType', + 'SshPublicAccess', + 'SslConfigurationStatus', + 'Status', 'UnderlyingResourceAction', + 'UnitOfMeasure', + 'UsageUnit', + 'VMPriceOSType', + 'VMTier', + 'VmPriority', ] diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_azure_machine_learning_workspaces_enums.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_azure_machine_learning_workspaces_enums.py index 0e95e8e3d7ff..efe5686a0c99 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_azure_machine_learning_workspaces_enums.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_azure_machine_learning_workspaces_enums.py @@ -1,62 +1,265 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) -class ProvisioningState(str, Enum): + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) - unknown = "Unknown" - updating = "Updating" - creating = "Creating" - deleting = "Deleting" - succeeded = "Succeeded" - failed = "Failed" - canceled = "Canceled" +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. + """ -class UsageUnit(str, Enum): + STEADY = "Steady" + RESIZING = "Resizing" - count = "Count" +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 ResourceIdentityType(str, Enum): +class BillingCurrency(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Three lettered code specifying the currency of the VM price. Example: USD + """ - system_assigned = "SystemAssigned" + USD = "USD" +class ComputeInstanceState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current state of a ComputeInstance. + """ -class VmPriority(str, Enum): + 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" - dedicated = "Dedicated" - low_priority = "LowPriority" +class ComputeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of compute + """ + AKS = "AKS" + AML_COMPUTE = "AmlCompute" + COMPUTE_INSTANCE = "ComputeInstance" + DATA_FACTORY = "DataFactory" + VIRTUAL_MACHINE = "VirtualMachine" + HD_INSIGHT = "HDInsight" + DATABRICKS = "Databricks" + DATA_LAKE_ANALYTICS = "DataLakeAnalytics" -class AllocationState(str, Enum): +class EncryptionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Indicates whether or not the encryption is enabled for the workspace. + """ - steady = "Steady" - resizing = "Resizing" + ENABLED = "Enabled" + DISABLED = "Disabled" +class NodeState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """State of the compute node. Values are idle, running, preparing, unusable, leaving and + preempted. + """ -class ComputeType(str, Enum): + IDLE = "idle" + RUNNING = "running" + PREPARING = "preparing" + UNUSABLE = "unusable" + LEAVING = "leaving" + PREEMPTED = "preempted" - aks = "AKS" - aml_compute = "AmlCompute" - data_factory = "DataFactory" - virtual_machine = "VirtualMachine" - hd_insight = "HDInsight" - databricks = "Databricks" - data_lake_analytics = "DataLakeAnalytics" +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 UnderlyingResourceAction(str, Enum): +class OperationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Operation status. + """ - delete = "Delete" - detach = "Detach" + IN_PROGRESS = "InProgress" + SUCCEEDED = "Succeeded" + CREATE_FAILED = "CreateFailed" + START_FAILED = "StartFailed" + STOP_FAILED = "StopFailed" + RESTART_FAILED = "RestartFailed" + REIMAGE_FAILED = "ReimageFailed" + DELETE_FAILED = "DeleteFailed" + +class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current provisioning state. + """ + + SUCCEEDED = "Succeeded" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + +class PrivateEndpointServiceConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The private endpoint connection status. + """ + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + DISCONNECTED = "Disconnected" + TIMEOUT = "Timeout" + +class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current deployment state of workspace resource. The provisioningState is to indicate states + for resource provisioning. + """ + + UNKNOWN = "Unknown" + UPDATING = "Updating" + CREATING = "Creating" + DELETING = "Deleting" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + +class QuotaUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """An enum describing the unit of quota measurement. + """ + + COUNT = "Count" + +class ReasonCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The reason for the restriction. + """ + + NOT_SPECIFIED = "NotSpecified" + NOT_AVAILABLE_FOR_REGION = "NotAvailableForRegion" + NOT_AVAILABLE_FOR_SUBSCRIPTION = "NotAvailableForSubscription" + +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 ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The identity type. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + NONE = "None" + +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 SslConfigurationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Enable or disable ssl for scoring + """ + + DISABLED = "Disabled" + ENABLED = "Enabled" + +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 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 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" diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models.py index 8ded2b35dd56..d95b81b6554e 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models.py @@ -1,67 +1,63 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +from azure.core.exceptions import HttpResponseError +import msrest.serialization -class Compute(Model): +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, VirtualMachine, HDInsight, DataFactory, - Databricks, DataLakeAnalytics + sub-classes are: AKS, AmlCompute, ComputeInstance, DataFactory, DataLakeAnalytics, Databricks, HDInsight, VirtualMachine. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param compute_location: Location for the underlying compute + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. :type 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' + :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 :param description: The description of the Machine Learning compute. :type description: str :ivar created_on: The date and time when the compute was created. - :vartype created_on: datetime + :vartype created_on: ~datetime.datetime :ivar modified_on: The date and time when the compute was last modified. - :vartype modified_on: datetime - :param resource_id: ARM resource id of the underlying compute + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. :type resource_id: str - :ivar provisioning_errors: Errors during provisioning + :ivar provisioning_errors: Errors during provisioning. :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] - :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. + :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 - :param compute_type: Required. Constant filled by server. - :type compute_type: str """ _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}, - 'compute_type': {'required': 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'}, @@ -70,15 +66,18 @@ class Compute(Model): 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[MachineLearningServiceError]'}, 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, } _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'VirtualMachine': 'VirtualMachine', 'HDInsight': 'HDInsight', 'DataFactory': 'DataFactory', 'Databricks': 'Databricks', 'DataLakeAnalytics': 'DataLakeAnalytics'} + 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'VirtualMachine': 'VirtualMachine'} } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): 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) @@ -87,56 +86,55 @@ def __init__(self, **kwargs): self.resource_id = kwargs.get('resource_id', None) self.provisioning_errors = None self.is_attached_compute = None - self.compute_type = None class AKS(Compute): """A Machine Learning compute based on AKS. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param compute_location: Location for the underlying compute + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. :type 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' + :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 :param description: The description of the Machine Learning compute. :type description: str :ivar created_on: The date and time when the compute was created. - :vartype created_on: datetime + :vartype created_on: ~datetime.datetime :ivar modified_on: The date and time when the compute was last modified. - :vartype modified_on: datetime - :param resource_id: ARM resource id of the underlying compute + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. :type resource_id: str - :ivar provisioning_errors: Errors during provisioning + :ivar provisioning_errors: Errors during provisioning. :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] - :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. + :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 - :param compute_type: Required. Constant filled by server. - :type compute_type: str - :param properties: AKS properties + :param properties: AKS properties. :type properties: ~azure.mgmt.machinelearningservices.models.AKSProperties """ _validation = { + 'compute_type': {'required': True}, 'provisioning_state': {'readonly': True}, 'created_on': {'readonly': True}, 'modified_on': {'readonly': True}, 'provisioning_errors': {'readonly': True}, 'is_attached_compute': {'readonly': True}, - 'compute_type': {'required': 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'}, @@ -145,28 +143,30 @@ class AKS(Compute): 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[MachineLearningServiceError]'}, 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'AKSProperties'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AKS, self).__init__(**kwargs) + self.compute_type = 'AKS' # type: str self.properties = kwargs.get('properties', None) - self.compute_type = 'AKS' -class ComputeSecrets(Model): - """Secrets related to a Machine Learning compute. Might differ for every type - of compute. +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, VirtualMachineSecrets, - DatabricksComputeSecrets + sub-classes are: AksComputeSecrets, DatabricksComputeSecrets, VirtualMachineSecrets. All required parameters must be populated in order to send to Azure. - :param compute_type: Required. Constant filled by server. - :type compute_type: str + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType """ _validation = { @@ -178,12 +178,15 @@ class ComputeSecrets(Model): } _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets', 'Databricks': 'DatabricksComputeSecrets'} + 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ComputeSecrets, self).__init__(**kwargs) - self.compute_type = None + self.compute_type = None # type: Optional[str] class AksComputeSecrets(ComputeSecrets): @@ -191,13 +194,15 @@ class AksComputeSecrets(ComputeSecrets): All required parameters must be populated in order to send to Azure. - :param compute_type: Required. Constant filled by server. - :type compute_type: str - :param user_kube_config: Content of kubeconfig file that can be used to - connect to the Kubernetes cluster. + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param user_kube_config: Content of kubeconfig file that can be used to connect to the + Kubernetes cluster. :type user_kube_config: str - :param admin_kube_config: Content of kubeconfig file that can be used to - connect to the Kubernetes cluster. + :param admin_kube_config: Content of kubeconfig file that can be used to connect to the + Kubernetes cluster. :type admin_kube_config: str :param image_pull_secret_name: Image registry pull secret. :type image_pull_secret_name: str @@ -214,30 +219,30 @@ class AksComputeSecrets(ComputeSecrets): 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AksComputeSecrets, self).__init__(**kwargs) + self.compute_type = 'AKS' # type: str 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' -class AksNetworkingConfiguration(Model): +class AksNetworkingConfiguration(msrest.serialization.Model): """Advance configuration for AKS networking. - :param subnet_id: Virtual network subnet resource ID the compute nodes - belong to + :param subnet_id: Virtual network subnet resource ID the compute nodes belong to. :type subnet_id: str - :param service_cidr: A CIDR notation IP range from which to assign service - cluster IPs. It must not overlap with any Subnet IP ranges. + :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + not overlap with any Subnet IP ranges. :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS - service. It must be within the Kubernetes service address range specified - in serviceCidr. + :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + the Kubernetes service address range specified in serviceCidr. :type dns_service_ip: str - :param 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. + :param 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. :type docker_bridge_cidr: str """ @@ -254,7 +259,10 @@ class AksNetworkingConfiguration(Model): 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AksNetworkingConfiguration, self).__init__(**kwargs) self.subnet_id = kwargs.get('subnet_id', None) self.service_cidr = kwargs.get('service_cidr', None) @@ -262,25 +270,22 @@ def __init__(self, **kwargs): self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', None) -class AKSProperties(Model): +class AKSProperties(msrest.serialization.Model): """AKS properties. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :param cluster_fqdn: Cluster full qualified domain name + :param cluster_fqdn: Cluster full qualified domain name. :type cluster_fqdn: str - :ivar system_services: System services - :vartype system_services: - list[~azure.mgmt.machinelearningservices.models.SystemService] - :param agent_count: Number of agents + :ivar system_services: System services. + :vartype system_services: list[~azure.mgmt.machinelearningservices.models.SystemService] + :param agent_count: Number of agents. :type agent_count: int - :param agent_vm_size: Agent virtual machine size + :param agent_vm_size: Agent virtual machine size. :type agent_vm_size: str - :param ssl_configuration: SSL configuration - :type ssl_configuration: - ~azure.mgmt.machinelearningservices.models.SslConfiguration - :param aks_networking_configuration: AKS networking configuration for vnet + :param ssl_configuration: SSL configuration. + :type ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration + :param aks_networking_configuration: AKS networking configuration for vnet. :type aks_networking_configuration: ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration """ @@ -299,7 +304,10 @@ class AKSProperties(Model): 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AKSProperties, self).__init__(**kwargs) self.cluster_fqdn = kwargs.get('cluster_fqdn', None) self.system_services = None @@ -312,51 +320,50 @@ def __init__(self, **kwargs): class AmlCompute(Compute): """An Azure Machine Learning compute. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param compute_location: Location for the underlying compute + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. :type 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' + :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 :param description: The description of the Machine Learning compute. :type description: str :ivar created_on: The date and time when the compute was created. - :vartype created_on: datetime + :vartype created_on: ~datetime.datetime :ivar modified_on: The date and time when the compute was last modified. - :vartype modified_on: datetime - :param resource_id: ARM resource id of the underlying compute + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. :type resource_id: str - :ivar provisioning_errors: Errors during provisioning + :ivar provisioning_errors: Errors during provisioning. :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] - :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. + :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 - :param compute_type: Required. Constant filled by server. - :type compute_type: str - :param properties: AML Compute properties - :type properties: - ~azure.mgmt.machinelearningservices.models.AmlComputeProperties + :param properties: AML Compute properties. + :type properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties """ _validation = { + 'compute_type': {'required': True}, 'provisioning_state': {'readonly': True}, 'created_on': {'readonly': True}, 'modified_on': {'readonly': True}, 'provisioning_errors': {'readonly': True}, 'is_attached_compute': {'readonly': True}, - 'compute_type': {'required': 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'}, @@ -365,174 +372,197 @@ class AmlCompute(Compute): 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[MachineLearningServiceError]'}, 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AmlCompute, self).__init__(**kwargs) + self.compute_type = 'AmlCompute' # type: str self.properties = kwargs.get('properties', None) - self.compute_type = 'AmlCompute' -class AmlComputeNodeInformation(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar node_id: Node ID. ID of the compute node. + :ivar node_id: ID of the compute node. :vartype node_id: str - :ivar ip_address: IP address. Public IP address of the compute node. - :vartype ip_address: str - :ivar port: Port. SSH port number of the node. - :vartype port: float + :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}, - 'ip_address': {'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'}, - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'float'}, + '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): + def __init__( + self, + **kwargs + ): super(AmlComputeNodeInformation, self).__init__(**kwargs) self.node_id = None - self.ip_address = None + self.private_ip_address = None + self.public_ip_address = None self.port = None + self.node_state = None + self.run_id = None -class ComputeNodesInformation(Model): - """Compute nodes information related to a Machine Learning compute. Might - differ for every type of compute. +class ComputeNodesInformation(msrest.serialization.Model): + """Compute nodes information 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: AmlComputeNodesInformation + sub-classes are: AmlComputeNodesInformation. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType :ivar next_link: The continuation token. :vartype next_link: str - :param compute_type: Required. Constant filled by server. - :type compute_type: str """ _validation = { - 'next_link': {'readonly': True}, 'compute_type': {'required': True}, + 'next_link': {'readonly': True}, } _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, 'compute_type': {'key': 'computeType', 'type': 'str'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } _subtype_map = { 'compute_type': {'AmlCompute': 'AmlComputeNodesInformation'} } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ComputeNodesInformation, self).__init__(**kwargs) + self.compute_type = None # type: Optional[str] self.next_link = None - self.compute_type = None class AmlComputeNodesInformation(ComputeNodesInformation): """Compute node information related to a AmlCompute. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType :ivar next_link: The continuation token. :vartype next_link: str - :param compute_type: Required. Constant filled by server. - :type compute_type: str :ivar nodes: The collection of returned AmlCompute nodes details. - :vartype nodes: - list[~azure.mgmt.machinelearningservices.models.AmlComputeNodeInformation] + :vartype nodes: list[~azure.mgmt.machinelearningservices.models.AmlComputeNodeInformation] """ _validation = { - 'next_link': {'readonly': True}, 'compute_type': {'required': True}, + 'next_link': {'readonly': True}, 'nodes': {'readonly': True}, } _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, 'compute_type': {'key': 'computeType', 'type': 'str'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AmlComputeNodesInformation, self).__init__(**kwargs) + self.compute_type = 'AmlCompute' # type: str self.nodes = None - self.compute_type = 'AmlCompute' -class AmlComputeProperties(Model): +class AmlComputeProperties(msrest.serialization.Model): """AML Compute properties. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :param vm_size: Virtual Machine Size + :param vm_size: Virtual Machine Size. :type vm_size: str - :param vm_priority: Virtual Machine priority. Possible values include: - 'Dedicated', 'LowPriority' - :type vm_priority: str or - ~azure.mgmt.machinelearningservices.models.VmPriority - :param scale_settings: Scale settings for AML Compute - :type scale_settings: - ~azure.mgmt.machinelearningservices.models.ScaleSettings - :param user_account_credentials: User account credentials. Credentials for - an administrator user account that will be created on each compute node. + :param vm_priority: Virtual Machine priority. Possible values include: "Dedicated", + "LowPriority". + :type vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority + :param scale_settings: Scale settings for AML Compute. + :type scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings + :param user_account_credentials: Credentials for an administrator user account that will be + created on each compute node. :type user_account_credentials: ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :param subnet: Subnet. Virtual network subnet resource ID the compute - nodes belong to. + :param subnet: Virtual network subnet resource ID the compute nodes belong to. :type subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar allocation_state: 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: Allocation state transition time. - The time at which the compute entered its current allocation state. - :vartype allocation_state_transition_time: datetime - :ivar errors: Errors. Collection of errors encountered by various compute - nodes during node setup. - :vartype errors: - list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] - :ivar current_node_count: Current node count. The number of compute nodes - currently assigned to the compute. + :param 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". + :type 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.MachineLearningServiceError] + :ivar current_node_count: The number of compute nodes currently assigned to the compute. :vartype current_node_count: int - :ivar target_node_count: 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 + :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: Node state counts. Counts of various node states - on the compute. - :vartype node_state_counts: - ~azure.mgmt.machinelearningservices.models.NodeStateCounts + :ivar node_state_counts: Counts of various node states on the compute. + :vartype node_state_counts: ~azure.mgmt.machinelearningservices.models.NodeStateCounts """ _validation = { @@ -550,6 +580,7 @@ class AmlComputeProperties(Model): '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': '[MachineLearningServiceError]'}, @@ -558,13 +589,17 @@ class AmlComputeProperties(Model): 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AmlComputeProperties, self).__init__(**kwargs) self.vm_size = kwargs.get('vm_size', None) self.vm_priority = kwargs.get('vm_priority', 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 @@ -573,56 +608,411 @@ def __init__(self, **kwargs): self.node_state_counts = None -class CloudError(Model): - """CloudError. +class AmlUserFeature(msrest.serialization.Model): + """Features enabled for a workspace. + + :param id: Specifies the feature ID. + :type id: str + :param display_name: Specifies the feature name. + :type display_name: str + :param description: Describes the feature for user experience. + :type description: str """ _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, } + def __init__( + self, + **kwargs + ): + 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 ClusterUpdateParameters(Model): +class ClusterUpdateParameters(msrest.serialization.Model): """AmlCompute update parameters. - :param scale_settings: Scale settings. Desired scale settings for the - amlCompute. - :type scale_settings: - ~azure.mgmt.machinelearningservices.models.ScaleSettings + :param scale_settings: Desired scale settings for the amlCompute. + :type scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings """ _attribute_map = { 'scale_settings': {'key': 'properties.scaleSettings', 'type': 'ScaleSettings'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ClusterUpdateParameters, self).__init__(**kwargs) self.scale_settings = kwargs.get('scale_settings', None) -class Resource(Model): +class ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user 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(ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class ComputeInstance(Compute): + """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. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. + :type 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 + :param description: The description of the Machine Learning compute. + :type description: str + :ivar created_on: The date and time when the compute was created. + :vartype created_on: ~datetime.datetime + :ivar modified_on: The date and time when the compute was last modified. + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. + :type resource_id: str + :ivar provisioning_errors: Errors during provisioning. + :vartype provisioning_errors: + list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :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 + :param properties: Compute Instance properties. + :type properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties + """ + + _validation = { + 'compute_type': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'created_on': {'readonly': True}, + 'modified_on': {'readonly': True}, + 'provisioning_errors': {'readonly': True}, + 'is_attached_compute': {'readonly': True}, + } + + _attribute_map = { + 'compute_type': {'key': 'computeType', 'type': 'str'}, + 'compute_location': {'key': 'computeLocation', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, + 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[MachineLearningServiceError]'}, + 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, + 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(ComputeInstance, self).__init__(**kwargs) + self.compute_type = 'ComputeInstance' # type: str + self.properties = kwargs.get('properties', None) + + +class ComputeInstanceApplication(msrest.serialization.Model): + """Defines an Aml Instance application and its connectivity endpoint URI. + + :param display_name: Name of the ComputeInstance application. + :type display_name: str + :param endpoint_uri: Application' endpoint URI. + :type endpoint_uri: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ComputeInstanceApplication, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.endpoint_uri = kwargs.get('endpoint_uri', None) + + +class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): + """Defines all connectivity endpoints and properties for a ComputeInstance. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar public_ip_address: Public IP Address of this ComputeInstance. + :vartype public_ip_address: str + :ivar private_ip_address: Private IP Address of this ComputeInstance (local to the VNET in + which the compute instance is deployed). + :vartype private_ip_address: str + """ + + _validation = { + 'public_ip_address': {'readonly': True}, + 'private_ip_address': {'readonly': True}, + } + + _attribute_map = { + 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) + self.public_ip_address = None + self.private_ip_address = None + + +class ComputeInstanceCreatedBy(msrest.serialization.Model): + """Describes information on user who created this ComputeInstance. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar user_name: Name of the user. + :vartype user_name: str + :ivar user_org_id: Uniquely identifies user' Azure Active Directory organization. + :vartype user_org_id: str + :ivar user_id: Uniquely identifies the user within his/her organization. + :vartype user_id: str + """ + + _validation = { + 'user_name': {'readonly': True}, + 'user_org_id': {'readonly': True}, + 'user_id': {'readonly': True}, + } + + _attribute_map = { + 'user_name': {'key': 'userName', 'type': 'str'}, + 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, + 'user_id': {'key': 'userId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ComputeInstanceCreatedBy, self).__init__(**kwargs) + self.user_name = None + self.user_org_id = None + self.user_id = None + + +class ComputeInstanceLastOperation(msrest.serialization.Model): + """The last operation on ComputeInstance. + + :param operation_name: Name of the last operation. Possible values include: "Create", "Start", + "Stop", "Restart", "Reimage", "Delete". + :type operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName + :param operation_time: Time of the last operation. + :type operation_time: ~datetime.datetime + :param operation_status: Operation status. Possible values include: "InProgress", "Succeeded", + "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ReimageFailed", "DeleteFailed". + :type operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus + """ + + _attribute_map = { + 'operation_name': {'key': 'operationName', 'type': 'str'}, + 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, + 'operation_status': {'key': 'operationStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ComputeInstanceLastOperation, self).__init__(**kwargs) + self.operation_name = kwargs.get('operation_name', None) + self.operation_time = kwargs.get('operation_time', None) + self.operation_status = kwargs.get('operation_status', None) + + +class ComputeInstanceProperties(msrest.serialization.Model): + """Compute Instance properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param vm_size: Virtual Machine Size. + :type vm_size: str + :param subnet: Virtual network subnet resource ID the compute nodes belong to. + :type subnet: ~azure.mgmt.machinelearningservices.models.ResourceId + :param 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". + :type application_sharing_policy: str or + ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy + :param ssh_settings: Specifies policy and settings for SSH access. + :type ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings + :ivar connectivity_endpoints: Describes all connectivity endpoints available for this + ComputeInstance. + :vartype connectivity_endpoints: + ~azure.mgmt.machinelearningservices.models.ComputeInstanceConnectivityEndpoints + :ivar applications: Describes available applications and their endpoints on this + ComputeInstance. + :vartype applications: + list[~azure.mgmt.machinelearningservices.models.ComputeInstanceApplication] + :ivar created_by: Describes information on user who created this ComputeInstance. + :vartype created_by: ~azure.mgmt.machinelearningservices.models.ComputeInstanceCreatedBy + :ivar errors: Collection of errors encountered on this ComputeInstance. + :vartype errors: list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :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 last_operation: The last operation on ComputeInstance. + :vartype last_operation: + ~azure.mgmt.machinelearningservices.models.ComputeInstanceLastOperation + """ + + _validation = { + 'connectivity_endpoints': {'readonly': True}, + 'applications': {'readonly': True}, + 'created_by': {'readonly': True}, + 'errors': {'readonly': True}, + 'state': {'readonly': True}, + 'last_operation': {'readonly': True}, + } + + _attribute_map = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, + 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, + 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, + 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, + 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, + 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, + 'errors': {'key': 'errors', 'type': '[MachineLearningServiceError]'}, + 'state': {'key': 'state', 'type': 'str'}, + 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, + } + + def __init__( + self, + **kwargs + ): + super(ComputeInstanceProperties, self).__init__(**kwargs) + self.vm_size = kwargs.get('vm_size', None) + self.subnet = kwargs.get('subnet', None) + self.application_sharing_policy = kwargs.get('application_sharing_policy', "Shared") + self.ssh_settings = kwargs.get('ssh_settings', None) + self.connectivity_endpoints = None + self.applications = None + self.created_by = None + self.errors = None + self.state = None + self.last_operation = 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. + + :param 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". + :type 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 + :param 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. + :type 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 + ): + super(ComputeInstanceSshSettings, self).__init__(**kwargs) + self.ssh_public_access = kwargs.get('ssh_public_access', "Disabled") + self.admin_user_name = None + self.ssh_port = None + self.admin_public_key = kwargs.get('admin_public_key', None) + + +class Resource(msrest.serialization.Model): """Azure Resource Manager resource envelope. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 name: Specifies the name of the resource. :vartype name: str - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.Identity + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.machinelearningservices.models.Identity :param location: Specifies the location of the resource. :type location: str :ivar type: Specifies the type of the resource. :vartype type: str - :param tags: Contains resource tags defined as key/value pairs. + :param tags: A set of tags. Contains resource tags defined as key/value pairs. :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, - 'identity': {'readonly': True}, 'type': {'readonly': True}, } @@ -633,44 +1023,49 @@ class Resource(Model): 'location': {'key': 'location', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None - self.identity = None + self.identity = kwargs.get('identity', None) self.location = kwargs.get('location', None) self.type = None self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) class ComputeResource(Resource): """Machine Learning compute object wrapped into ARM resource envelope. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 name: Specifies the name of the resource. :vartype name: str - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.Identity + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.machinelearningservices.models.Identity :param location: Specifies the location of the resource. :type location: str :ivar type: Specifies the type of the resource. :vartype type: str - :param tags: Contains resource tags defined as key/value pairs. + :param tags: A set of tags. Contains resource tags defined as key/value pairs. :type tags: dict[str, str] - :param properties: Compute properties + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :param properties: Compute properties. :type properties: ~azure.mgmt.machinelearningservices.models.Compute """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, - 'identity': {'readonly': True}, 'type': {'readonly': True}, } @@ -681,10 +1076,14 @@ class ComputeResource(Resource): 'location': {'key': 'location', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, 'properties': {'key': 'properties', 'type': 'Compute'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ComputeResource, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) @@ -692,51 +1091,50 @@ def __init__(self, **kwargs): class Databricks(Compute): """A DataFactory compute. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param compute_location: Location for the underlying compute + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. :type 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' + :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 :param description: The description of the Machine Learning compute. :type description: str :ivar created_on: The date and time when the compute was created. - :vartype created_on: datetime + :vartype created_on: ~datetime.datetime :ivar modified_on: The date and time when the compute was last modified. - :vartype modified_on: datetime - :param resource_id: ARM resource id of the underlying compute + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. :type resource_id: str - :ivar provisioning_errors: Errors during provisioning + :ivar provisioning_errors: Errors during provisioning. :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] - :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. + :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 - :param compute_type: Required. Constant filled by server. - :type compute_type: str :param properties: - :type properties: - ~azure.mgmt.machinelearningservices.models.DatabricksProperties + :type properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties """ _validation = { + 'compute_type': {'required': True}, 'provisioning_state': {'readonly': True}, 'created_on': {'readonly': True}, 'modified_on': {'readonly': True}, 'provisioning_errors': {'readonly': True}, 'is_attached_compute': {'readonly': True}, - 'compute_type': {'required': 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'}, @@ -745,14 +1143,16 @@ class Databricks(Compute): 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[MachineLearningServiceError]'}, 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Databricks, self).__init__(**kwargs) + self.compute_type = 'Databricks' # type: str self.properties = kwargs.get('properties', None) - self.compute_type = 'Databricks' class DatabricksComputeSecrets(ComputeSecrets): @@ -760,8 +1160,10 @@ class DatabricksComputeSecrets(ComputeSecrets): All required parameters must be populated in order to send to Azure. - :param compute_type: Required. Constant filled by server. - :type compute_type: str + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType :param databricks_access_token: access token for databricks account. :type databricks_access_token: str """ @@ -775,16 +1177,19 @@ class DatabricksComputeSecrets(ComputeSecrets): 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DatabricksComputeSecrets, self).__init__(**kwargs) + self.compute_type = 'Databricks' # type: str self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.compute_type = 'Databricks' -class DatabricksProperties(Model): +class DatabricksProperties(msrest.serialization.Model): """DatabricksProperties. - :param databricks_access_token: Databricks access token + :param databricks_access_token: Databricks access token. :type databricks_access_token: str """ @@ -792,7 +1197,10 @@ class DatabricksProperties(Model): 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DatabricksProperties, self).__init__(**kwargs) self.databricks_access_token = kwargs.get('databricks_access_token', None) @@ -800,48 +1208,48 @@ def __init__(self, **kwargs): class DataFactory(Compute): """A DataFactory compute. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param compute_location: Location for the underlying compute + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. :type 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' + :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 :param description: The description of the Machine Learning compute. :type description: str :ivar created_on: The date and time when the compute was created. - :vartype created_on: datetime + :vartype created_on: ~datetime.datetime :ivar modified_on: The date and time when the compute was last modified. - :vartype modified_on: datetime - :param resource_id: ARM resource id of the underlying compute + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. :type resource_id: str - :ivar provisioning_errors: Errors during provisioning + :ivar provisioning_errors: Errors during provisioning. :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] - :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. + :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 - :param compute_type: Required. Constant filled by server. - :type compute_type: str """ _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}, - 'compute_type': {'required': 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'}, @@ -850,62 +1258,63 @@ class DataFactory(Compute): 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[MachineLearningServiceError]'}, 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataFactory, self).__init__(**kwargs) - self.compute_type = 'DataFactory' + self.compute_type = 'DataFactory' # type: str class DataLakeAnalytics(Compute): """A DataLakeAnalytics compute. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param compute_location: Location for the underlying compute + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. :type 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' + :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 :param description: The description of the Machine Learning compute. :type description: str :ivar created_on: The date and time when the compute was created. - :vartype created_on: datetime + :vartype created_on: ~datetime.datetime :ivar modified_on: The date and time when the compute was last modified. - :vartype modified_on: datetime - :param resource_id: ARM resource id of the underlying compute + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. :type resource_id: str - :ivar provisioning_errors: Errors during provisioning + :ivar provisioning_errors: Errors during provisioning. :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] - :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. + :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 - :param compute_type: Required. Constant filled by server. - :type compute_type: str :param properties: - :type properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsProperties + :type properties: ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsProperties """ _validation = { + 'compute_type': {'required': True}, 'provisioning_state': {'readonly': True}, 'created_on': {'readonly': True}, 'modified_on': {'readonly': True}, 'provisioning_errors': {'readonly': True}, 'is_attached_compute': {'readonly': True}, - 'compute_type': {'required': 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'}, @@ -914,20 +1323,22 @@ class DataLakeAnalytics(Compute): 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[MachineLearningServiceError]'}, 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsProperties'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataLakeAnalytics, self).__init__(**kwargs) + self.compute_type = 'DataLakeAnalytics' # type: str self.properties = kwargs.get('properties', None) - self.compute_type = 'DataLakeAnalytics' -class DataLakeAnalyticsProperties(Model): +class DataLakeAnalyticsProperties(msrest.serialization.Model): """DataLakeAnalyticsProperties. - :param data_lake_store_account_name: DataLake Store Account Name + :param data_lake_store_account_name: DataLake Store Account Name. :type data_lake_store_account_name: str """ @@ -935,12 +1346,46 @@ class DataLakeAnalyticsProperties(Model): 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(DataLakeAnalyticsProperties, self).__init__(**kwargs) self.data_lake_store_account_name = kwargs.get('data_lake_store_account_name', None) -class ErrorDetail(Model): +class EncryptionProperty(msrest.serialization.Model): + """EncryptionProperty. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. Indicates whether or not the encryption is enabled for the workspace. + Possible values include: "Enabled", "Disabled". + :type status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus + :param key_vault_properties: Required. Customer Key vault properties. + :type key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties + """ + + _validation = { + 'status': {'required': True}, + 'key_vault_properties': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(EncryptionProperty, self).__init__(**kwargs) + self.status = kwargs['status'] + self.key_vault_properties = kwargs['key_vault_properties'] + + +class ErrorDetail(msrest.serialization.Model): """Error detail information. All required parameters must be populated in order to send to Azure. @@ -961,25 +1406,26 @@ class ErrorDetail(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ErrorDetail, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) + self.code = kwargs['code'] + self.message = kwargs['message'] -class ErrorResponse(Model): +class ErrorResponse(msrest.serialization.Model): """Error response information. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar code: Error code. :vartype code: str :ivar message: Error message. :vartype message: str :ivar details: An array of error detail objects. - :vartype details: - list[~azure.mgmt.machinelearningservices.models.ErrorDetail] + :vartype details: list[~azure.mgmt.machinelearningservices.models.ErrorDetail] """ _validation = { @@ -994,61 +1440,138 @@ class ErrorResponse(Model): 'details': {'key': 'details', 'type': '[ErrorDetail]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ErrorResponse, self).__init__(**kwargs) self.code = None self.message = None self.details = 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. + + :param retail_price: Required. The price charged for using the VM. + :type retail_price: float + :param os_type: Required. Operating system type used by the VM. Possible values include: + "Linux", "Windows". + :type os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType + :param vm_tier: Required. The type of the VM. Possible values include: "Standard", + "LowPriority", "Spot". + :type 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 + ): + 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. + + :param billing_currency: Required. Three lettered code specifying the currency of the VM price. + Example: USD. Possible values include: "USD". + :type billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency + :param unit_of_measure: Required. The unit of time measurement for the specified VM price. + Example: OneHour. Possible values include: "OneHour". + :type unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure + :param values: Required. The list of estimated prices for using a VM of a particular OS type, + tier, etc. + :type 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 + ): + super(EstimatedVMPrices, self).__init__(**kwargs) + self.billing_currency = kwargs['billing_currency'] + self.unit_of_measure = kwargs['unit_of_measure'] + self.values = kwargs['values'] + + class HDInsight(Compute): """A HDInsight compute. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param compute_location: Location for the underlying compute + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. :type 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' + :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 :param description: The description of the Machine Learning compute. :type description: str :ivar created_on: The date and time when the compute was created. - :vartype created_on: datetime + :vartype created_on: ~datetime.datetime :ivar modified_on: The date and time when the compute was last modified. - :vartype modified_on: datetime - :param resource_id: ARM resource id of the underlying compute + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. :type resource_id: str - :ivar provisioning_errors: Errors during provisioning + :ivar provisioning_errors: Errors during provisioning. :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] - :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. + :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 - :param compute_type: Required. Constant filled by server. - :type compute_type: str :param properties: - :type properties: - ~azure.mgmt.machinelearningservices.models.HDInsightProperties + :type properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties """ _validation = { + 'compute_type': {'required': True}, 'provisioning_state': {'readonly': True}, 'created_on': {'readonly': True}, 'modified_on': {'readonly': True}, 'provisioning_errors': {'readonly': True}, 'is_attached_compute': {'readonly': True}, - 'compute_type': {'required': 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'}, @@ -1057,26 +1580,26 @@ class HDInsight(Compute): 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[MachineLearningServiceError]'}, 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(HDInsight, self).__init__(**kwargs) + self.compute_type = 'HDInsight' # type: str self.properties = kwargs.get('properties', None) - self.compute_type = 'HDInsight' -class HDInsightProperties(Model): +class HDInsightProperties(msrest.serialization.Model): """HDInsightProperties. - :param ssh_port: Port open for ssh connections on the master node of the - cluster. + :param ssh_port: Port open for ssh connections on the master node of the cluster. :type ssh_port: int :param address: Public IP address of the master node of the cluster. :type address: str - :param administrator_account: Admin credentials for master node of the - cluster + :param administrator_account: Admin credentials for master node of the cluster. :type administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ @@ -1087,143 +1610,277 @@ class HDInsightProperties(Model): 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(HDInsightProperties, self).__init__(**kwargs) self.ssh_port = kwargs.get('ssh_port', None) self.address = kwargs.get('address', None) self.administrator_account = kwargs.get('administrator_account', None) -class Identity(Model): +class Identity(msrest.serialization.Model): """Identity for the resource. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated 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 principal ID of resource identity. :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :param type: The identity type. Possible values include: 'SystemAssigned' - :type type: str or - ~azure.mgmt.machinelearningservices.models.ResourceIdentityType + :param type: Required. The identity type. Possible values include: "SystemAssigned", + "UserAssigned", "SystemAssigned,UserAssigned", "None". + :type type: str or ~azure.mgmt.machinelearningservices.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with resource. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.machinelearningservices.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] """ _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': 'ResourceIdentityType'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Identity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = kwargs.get('type', None) + self.type = kwargs['type'] + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) -class ListWorkspaceKeysResult(Model): - """ListWorkspaceKeysResult. +class KeyVaultProperties(msrest.serialization.Model): + """KeyVaultProperties. - Variables are only populated by the server, and will be ignored when - sending a request. + All required parameters must be populated in order to send to Azure. - :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 + :param key_vault_arm_id: Required. The ArmId of the keyVault where the customer owned + encryption key is present. + :type key_vault_arm_id: str + :param key_identifier: Required. Key vault uri to access the encryption key. + :type key_identifier: str + :param identity_client_id: For future use - The client id of the identity which will be used to + access key vault. + :type identity_client_id: str """ _validation = { - 'user_storage_key': {'readonly': True}, - 'user_storage_resource_id': {'readonly': True}, - 'app_insights_instrumentation_key': {'readonly': True}, - 'container_registry_credentials': {'readonly': True}, + 'key_vault_arm_id': {'required': True}, + 'key_identifier': {'required': 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'}, + '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): - 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 + def __init__( + self, + **kwargs + ): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_vault_arm_id = kwargs['key_vault_arm_id'] + self.key_identifier = kwargs['key_identifier'] + self.identity_client_id = kwargs.get('identity_client_id', None) -class MachineLearningServiceError(Model): - """Wrapper for error response to follow ARM guidelines. +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. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar error: The error response. - :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorResponse + :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 = { - 'error': {'readonly': True}, + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorResponse'}, + 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, **kwargs): - super(MachineLearningServiceError, self).__init__(**kwargs) - self.error = None + def __init__( + self, + **kwargs + ): + super(ListAmlUserFeatureResult, self).__init__(**kwargs) + self.value = None + self.next_link = 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 + :param notebook_access_keys: + :type notebook_access_keys: + ~azure.mgmt.machinelearningservices.models.NotebookListCredentialsResult + """ + + _validation = { + 'user_storage_key': {'readonly': True}, + 'user_storage_resource_id': {'readonly': True}, + 'app_insights_instrumentation_key': {'readonly': True}, + 'container_registry_credentials': {'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': 'NotebookListCredentialsResult'}, + } + + 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 = kwargs.get('notebook_access_keys', None) + +class ListWorkspaceQuotas(msrest.serialization.Model): + """The List WorkspaceQuotasByVMFamily operation response. -class MachineLearningServiceErrorException(HttpOperationError): - """Server responsed with exception of type: 'MachineLearningServiceError'. + Variables are only populated by the server, and will be ignored when sending a request. - :param deserialize: A deserializer - :param response: Server response to be deserialized. + :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 """ - def __init__(self, deserialize, response, *args): + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceQuota]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } - super(MachineLearningServiceErrorException, self).__init__(deserialize, response, 'MachineLearningServiceError', *args) + def __init__( + self, + **kwargs + ): + super(ListWorkspaceQuotas, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class MachineLearningServiceError(msrest.serialization.Model): + """Wrapper for error response to follow ARM guidelines. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: The error response. + :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorResponse + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineLearningServiceError, self).__init__(**kwargs) + self.error = None -class NodeStateCounts(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar idle_node_count: Idle node count. Number of compute nodes in idle - state. + :ivar idle_node_count: Number of compute nodes in idle state. :vartype idle_node_count: int - :ivar running_node_count: Running node count. Number of compute nodes - which are running jobs. + :ivar running_node_count: Number of compute nodes which are running jobs. :vartype running_node_count: int - :ivar preparing_node_count: Preparing node count. Number of compute nodes - which are being prepared. + :ivar preparing_node_count: Number of compute nodes which are being prepared. :vartype preparing_node_count: int - :ivar unusable_node_count: Unusable node count. Number of compute nodes - which are in unusable state. + :ivar unusable_node_count: Number of compute nodes which are in unusable state. :vartype unusable_node_count: int - :ivar leaving_node_count: Leaving node count. Number of compute nodes - which are leaving the amlCompute. + :ivar leaving_node_count: Number of compute nodes which are leaving the amlCompute. :vartype leaving_node_count: int - :ivar preempted_node_count: Preempted node count. Number of compute nodes - which are in preempted state. + :ivar preempted_node_count: Number of compute nodes which are in preempted state. :vartype preempted_node_count: int """ @@ -1245,7 +1902,10 @@ class NodeStateCounts(Model): 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(NodeStateCounts, self).__init__(**kwargs) self.idle_node_count = None self.running_node_count = None @@ -1255,12 +1915,86 @@ def __init__(self, **kwargs): self.preempted_node_count = None -class Operation(Model): +class NotebookListCredentialsResult(msrest.serialization.Model): + """NotebookListCredentialsResult. + + :param primary_access_key: + :type primary_access_key: str + :param secondary_access_key: + :type secondary_access_key: str + """ + + _attribute_map = { + 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, + 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NotebookListCredentialsResult, self).__init__(**kwargs) + self.primary_access_key = kwargs.get('primary_access_key', None) + self.secondary_access_key = kwargs.get('secondary_access_key', None) + + +class NotebookPreparationError(msrest.serialization.Model): + """NotebookPreparationError. + + :param error_message: + :type error_message: str + :param status_code: + :type status_code: int + """ + + _attribute_map = { + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'status_code': {'key': 'statusCode', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + 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. + + :param fqdn: + :type fqdn: str + :param resource_id: the data plane resourceId that used to initialize notebook component. + :type resource_id: str + :param notebook_preparation_error: The error that occurs when preparing notebook. + :type 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 + ): + super(NotebookResourceInfo, self).__init__(**kwargs) + self.fqdn = kwargs.get('fqdn', None) + self.resource_id = kwargs.get('resource_id', None) + self.notebook_preparation_error = kwargs.get('notebook_preparation_error', None) + + +class Operation(msrest.serialization.Model): """Azure Machine Learning workspace REST API operation. - :param name: Operation name: {provider}/{resource}/{operation} + :param name: Operation name: {provider}/{resource}/{operation}. :type name: str - :param display: Display name of operation + :param display: Display name of operation. :type display: ~azure.mgmt.machinelearningservices.models.OperationDisplay """ @@ -1269,17 +2003,19 @@ class Operation(Model): 'display': {'key': 'display', 'type': 'OperationDisplay'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Operation, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.display = kwargs.get('display', None) -class OperationDisplay(Model): +class OperationDisplay(msrest.serialization.Model): """Display name of operation. - :param provider: The resource provider name: - Microsoft.MachineLearningExperimentation + :param provider: The resource provider name: Microsoft.MachineLearningExperimentation. :type provider: str :param resource: The resource on which the operation is performed. :type resource: str @@ -1290,115 +2026,602 @@ class OperationDisplay(Model): """ _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class OperationListResult(msrest.serialization.Model): + """An array of operations supported by the resource provider. + + :param value: List of AML workspace operations supported by the AML workspace resource + provider. + :type value: list[~azure.mgmt.machinelearningservices.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PaginatedComputeResourcesList(msrest.serialization.Model): + """Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. + + :param value: An array of Machine Learning compute objects wrapped in ARM resource envelope. + :type value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] + :param next_link: A continuation link (absolute URI) to the next page of results in the list. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ComputeResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PaginatedComputeResourcesList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class PaginatedWorkspaceConnectionsList(msrest.serialization.Model): + """Paginated list of Workspace connection objects. + + :param value: An array of Workspace connection objects. + :type value: list[~azure.mgmt.machinelearningservices.models.WorkspaceConnection] + :param next_link: A continuation link (absolute URI) to the next page of results in the list. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkspaceConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PaginatedWorkspaceConnectionsList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class Password(msrest.serialization.Model): + """Password. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: + :vartype name: str + :ivar value: + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Password, self).__init__(**kwargs) + self.name = None + self.value = None + + +class 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(msrest.serialization.Model): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: ResourceId of the private endpoint connection. + :vartype id: str + :ivar name: Friendly name of the private endpoint connection. + :vartype name: str + :ivar type: Resource type of private endpoint connection. + :vartype type: str + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type 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}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + '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 + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = 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 PrivateLinkResource(Resource): + """A private link 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 name: Specifies the name of the resource. + :vartype name: str + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.machinelearningservices.models.Identity + :param location: Specifies the location of the resource. + :type location: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :param tags: A set of tags. Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type 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] + :param required_zone_names: The private link resource Private link DNS zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', '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 + ): + super(PrivateLinkResource, self).__init__(**kwargs) + 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. + + :param value: Array of private link resources. + :type value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + **kwargs + ): + 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. + + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected", "Disconnected", + "Timeout". + :type status: str or + ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :type 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 + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = kwargs.get('actions_required', None) + + +class QuotaBaseProperties(msrest.serialization.Model): + """The properties for Quota update or retrieval. + + :param id: Specifies the resource ID. + :type id: str + :param type: Specifies the resource type. + :type type: str + :param limit: The maximum permitted quota of the resource. + :type limit: long + :param unit: An enum describing the unit of quota measurement. Possible values include: + "Count". + :type 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 + ): + 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. + + :param value: The list for update quota. + :type value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(QuotaUpdateParameters, self).__init__(**kwargs) + self.value = kwargs.get('value', 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 + :param passwords: + :type 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 + ): + super(RegistryListCredentialsResult, self).__init__(**kwargs) + self.location = None + self.username = None + self.passwords = kwargs.get('passwords', 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. + + :param id: Required. The ID of the resource. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + 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(OperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) + def __init__( + self, + **kwargs + ): + super(ResourceName, self).__init__(**kwargs) + self.value = None + self.localized_value = None -class Password(Model): - """Password. +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. + 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 + :ivar id: Specifies the resource ID. + :vartype id: 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}, + 'type': {'readonly': True}, 'name': {'readonly': True}, - 'value': {'readonly': True}, + 'limit': {'readonly': True}, + 'unit': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + 'id': {'key': 'id', '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(Password, self).__init__(**kwargs) + def __init__( + self, + **kwargs + ): + super(ResourceQuota, self).__init__(**kwargs) + self.id = None + self.type = None self.name = None - self.value = None + self.limit = None + self.unit = None -class RegistryListCredentialsResult(Model): - """RegistryListCredentialsResult. +class ResourceSkuLocationInfo(msrest.serialization.Model): + """ResourceSkuLocationInfo. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar location: + :ivar location: Location of the SKU. :vartype location: str - :ivar username: - :vartype username: str - :param passwords: - :type passwords: list[~azure.mgmt.machinelearningservices.models.Password] + :ivar zones: List of availability zones where the SKU is supported. + :vartype zones: list[str] + :ivar zone_details: Details of capabilities available to a SKU in specific zones. + :vartype zone_details: list[~azure.mgmt.machinelearningservices.models.ResourceSkuZoneDetails] """ _validation = { 'location': {'readonly': True}, - 'username': {'readonly': True}, + 'zones': {'readonly': True}, + 'zone_details': {'readonly': True}, } _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'zone_details': {'key': 'zoneDetails', 'type': '[ResourceSkuZoneDetails]'}, } - def __init__(self, **kwargs): - super(RegistryListCredentialsResult, self).__init__(**kwargs) + def __init__( + self, + **kwargs + ): + super(ResourceSkuLocationInfo, self).__init__(**kwargs) self.location = None - self.username = None - self.passwords = kwargs.get('passwords', None) + self.zones = None + self.zone_details = None -class ResourceId(Model): - """Represents a resource ID. For example, for a subnet, it is the resource URL - for the subnet. +class ResourceSkuZoneDetails(msrest.serialization.Model): + """Describes The zonal capabilities of a SKU. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param id: Required. The ID of the resource - :type id: str + :ivar name: The set of zones that the SKU is available in with the specified capabilities. + :vartype name: list[str] + :ivar capabilities: A list of capabilities that are available for the SKU in the specified list + of zones. + :vartype capabilities: list[~azure.mgmt.machinelearningservices.models.SKUCapability] """ _validation = { - 'id': {'required': True}, + 'name': {'readonly': True}, + 'capabilities': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, } - def __init__(self, **kwargs): - super(ResourceId, self).__init__(**kwargs) - self.id = kwargs.get('id', None) + def __init__( + self, + **kwargs + ): + super(ResourceSkuZoneDetails, self).__init__(**kwargs) + self.name = None + self.capabilities = None + + +class Restriction(msrest.serialization.Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of restrictions. As of now only possible value for this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to location. This would + be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. Possible values include: "NotSpecified", + "NotAvailableForRegion", "NotAvailableForSubscription". + :type reason_code: str or ~azure.mgmt.machinelearningservices.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = kwargs.get('reason_code', None) -class ScaleSettings(Model): +class ScaleSettings(msrest.serialization.Model): """scale settings for AML Compute. All required parameters must be populated in order to send to Azure. - :param max_node_count: Required. Max number of nodes to use + :param max_node_count: Required. Max number of nodes to use. :type max_node_count: int - :param min_node_count: Min number of nodes to use. Default value: 0 . + :param min_node_count: Min number of nodes to use. :type min_node_count: int - :param node_idle_time_before_scale_down: Node Idle Time before scaling - down amlCompute - :type node_idle_time_before_scale_down: timedelta + :param node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. + :type node_idle_time_before_scale_down: ~datetime.timedelta """ _validation = { @@ -1411,21 +2634,24 @@ class ScaleSettings(Model): 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ScaleSettings, self).__init__(**kwargs) - self.max_node_count = kwargs.get('max_node_count', None) + 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 ServicePrincipalCredentials(Model): +class ServicePrincipalCredentials(msrest.serialization.Model): """Service principal credentials. All required parameters must be populated in order to send to Azure. - :param client_id: Required. Client Id + :param client_id: Required. Client Id. :type client_id: str - :param client_secret: Required. Client secret + :param client_secret: Required. Client secret. :type client_secret: str """ @@ -1439,23 +2665,192 @@ class ServicePrincipalCredentials(Model): 'client_secret': {'key': 'clientSecret', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ServicePrincipalCredentials, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.client_secret = kwargs.get('client_secret', None) + self.client_id = kwargs['client_id'] + self.client_secret = kwargs['client_secret'] + + +class SharedPrivateLinkResource(msrest.serialization.Model): + """SharedPrivateLinkResource. + + :param name: Unique name of the private link. + :type name: str + :param private_link_resource_id: The resource id that private link links to. + :type private_link_resource_id: str + :param group_id: The private link resource group id. + :type group_id: str + :param request_message: Request message. + :type request_message: str + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected", "Disconnected", + "Timeout". + :type 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 + ): + super(SharedPrivateLinkResource, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.private_link_resource_id = kwargs.get('private_link_resource_id', None) + self.group_id = kwargs.get('group_id', None) + self.request_message = kwargs.get('request_message', None) + self.status = kwargs.get('status', None) + + +class Sku(msrest.serialization.Model): + """Sku of the resource. + + :param name: Name of the sku. + :type name: str + :param tier: Tier of the sku like Basic or Enterprise. + :type tier: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + + +class SKUCapability(msrest.serialization.Model): + """Features/user capabilities associated with the sku. + + :param name: Capability/Feature ID. + :type name: str + :param value: Details about the feature/capability. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SKUCapability, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class SkuListResult(msrest.serialization.Model): + """List of skus with features. + + :param value: + :type value: list[~azure.mgmt.machinelearningservices.models.WorkspaceSku] + :param next_link: The URI to fetch the next page of Workspace Skus. Call ListNext() with this + URI to fetch the next page of Workspace Skus. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkspaceSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + def __init__( + self, + **kwargs + ): + super(SkuListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) -class SslConfiguration(Model): + +class SkuSettings(msrest.serialization.Model): + """Describes Workspace Sku details and features. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar locations: The set of locations that the SKU is available. This will be supported and + registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). + :vartype locations: list[str] + :ivar location_info: A list of locations and availability zones in those locations where the + SKU is available. + :vartype location_info: + list[~azure.mgmt.machinelearningservices.models.ResourceSkuLocationInfo] + :ivar tier: Sku Tier like Basic or Enterprise. + :vartype tier: str + :ivar resource_type: + :vartype resource_type: str + :ivar name: + :vartype name: str + :ivar capabilities: List of features/user capabilities associated with the sku. + :vartype capabilities: list[~azure.mgmt.machinelearningservices.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. This is empty if + there are no restrictions. + :type restrictions: list[~azure.mgmt.machinelearningservices.models.Restriction] + """ + + _validation = { + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[ResourceSkuLocationInfo]'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuSettings, self).__init__(**kwargs) + self.locations = None + self.location_info = None + self.tier = None + self.resource_type = None + self.name = None + self.capabilities = None + self.restrictions = kwargs.get('restrictions', None) + + +class SslConfiguration(msrest.serialization.Model): """The ssl configuration for scoring. - :param status: Enable or disable ssl for scoring. Possible values include: - 'Disabled', 'Enabled' - :type status: str or ~azure.mgmt.machinelearningservices.models.enum - :param cert: Cert data + :param status: Enable or disable ssl for scoring. Possible values include: "Disabled", + "Enabled". + :type status: str or ~azure.mgmt.machinelearningservices.models.SslConfigurationStatus + :param cert: Cert data. :type cert: str - :param key: Key data + :param key: Key data. :type key: str - :param cname: CNAME of the cert + :param cname: CNAME of the cert. :type cname: str """ @@ -1466,7 +2861,10 @@ class SslConfiguration(Model): 'cname': {'key': 'cname', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SslConfiguration, self).__init__(**kwargs) self.status = kwargs.get('status', None) self.cert = kwargs.get('cert', None) @@ -1474,15 +2872,14 @@ def __init__(self, **kwargs): self.cname = kwargs.get('cname', None) -class SystemService(Model): +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. + 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 + :ivar public_ip_address: Public IP address. :vartype public_ip_address: str :ivar version: The version for this type. :vartype version: str @@ -1500,25 +2897,103 @@ class SystemService(Model): 'version': {'key': 'version', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SystemService, self).__init__(**kwargs) self.system_service_type = None self.public_ip_address = None self.version = None -class Usage(Model): +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 + :param limit: The maximum permitted quota of the resource. + :type 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 + :param status: Status of update workspace quota. Possible values include: "Undefined", + "Success", "Failure", "InvalidQuotaBelowClusterMinimum", + "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", + "OperationNotEnabledForRegion". + :type 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 + ): + super(UpdateWorkspaceQuotas, self).__init__(**kwargs) + self.id = None + self.type = None + self.limit = kwargs.get('limit', None) + self.unit = None + self.status = kwargs.get('status', None) + + +class UpdateWorkspaceQuotasResult(msrest.serialization.Model): + """The result of update workspace quota. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of workspace quota update result. + :vartype value: list[~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotas] + :ivar next_link: The URI to fetch the next page of workspace quota update result. Call + ListNext() with this to fetch the next page of Workspace Quota update result. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Usage(msrest.serialization.Model): """Describes AML Resource Usage. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 unit: An enum describing the unit of usage measurement. Possible - values include: 'Count' + :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 @@ -1546,7 +3021,10 @@ class Usage(Model): 'name': {'key': 'name', 'type': 'UsageName'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Usage, self).__init__(**kwargs) self.id = None self.type = None @@ -1556,11 +3034,10 @@ def __init__(self, **kwargs): self.name = None -class UsageName(Model): +class UsageName(msrest.serialization.Model): """The Usage Names. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -1578,26 +3055,26 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None -class UserAccountCredentials(Model): - """Settings for user account that gets created on each on the nodes of a - compute. +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. - :param admin_user_name: Required. User name. Name of the administrator - user account which can be used to SSH to nodes. + :param admin_user_name: Required. Name of the administrator user account which can be used to + SSH to nodes. :type admin_user_name: str - :param admin_user_ssh_public_key: SSH public key. SSH public key of the - administrator user account. + :param admin_user_ssh_public_key: SSH public key of the administrator user account. :type admin_user_ssh_public_key: str - :param admin_user_password: Password. Password of the administrator user - account. + :param admin_user_password: Password of the administrator user account. :type admin_user_password: str """ @@ -1611,9 +3088,12 @@ class UserAccountCredentials(Model): 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(UserAccountCredentials, self).__init__(**kwargs) - self.admin_user_name = kwargs.get('admin_user_name', None) + 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) @@ -1621,51 +3101,50 @@ def __init__(self, **kwargs): class VirtualMachine(Compute): """A Machine Learning compute based on Azure Virtual Machines. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param compute_location: Location for the underlying compute + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. :type 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' + :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 :param description: The description of the Machine Learning compute. :type description: str :ivar created_on: The date and time when the compute was created. - :vartype created_on: datetime + :vartype created_on: ~datetime.datetime :ivar modified_on: The date and time when the compute was last modified. - :vartype modified_on: datetime - :param resource_id: ARM resource id of the underlying compute + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. :type resource_id: str - :ivar provisioning_errors: Errors during provisioning + :ivar provisioning_errors: Errors during provisioning. :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] - :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. + :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 - :param compute_type: Required. Constant filled by server. - :type compute_type: str :param properties: - :type properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineProperties + :type properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineProperties """ _validation = { + 'compute_type': {'required': True}, 'provisioning_state': {'readonly': True}, 'created_on': {'readonly': True}, 'modified_on': {'readonly': True}, 'provisioning_errors': {'readonly': True}, 'is_attached_compute': {'readonly': True}, - 'compute_type': {'required': 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'}, @@ -1674,26 +3153,28 @@ class VirtualMachine(Compute): 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[MachineLearningServiceError]'}, 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'VirtualMachineProperties'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(VirtualMachine, self).__init__(**kwargs) + self.compute_type = 'VirtualMachine' # type: str self.properties = kwargs.get('properties', None) - self.compute_type = 'VirtualMachine' -class VirtualMachineProperties(Model): +class VirtualMachineProperties(msrest.serialization.Model): """VirtualMachineProperties. - :param virtual_machine_size: Virtual Machine size + :param virtual_machine_size: Virtual Machine size. :type virtual_machine_size: str :param ssh_port: Port open for ssh connections. :type ssh_port: int :param address: Public IP address of the virtual machine. :type address: str - :param administrator_account: Admin credentials for virtual machine + :param administrator_account: Admin credentials for virtual machine. :type administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ @@ -1705,7 +3186,10 @@ class VirtualMachineProperties(Model): 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(VirtualMachineProperties, self).__init__(**kwargs) self.virtual_machine_size = kwargs.get('virtual_machine_size', None) self.ssh_port = kwargs.get('ssh_port', None) @@ -1718,8 +3202,10 @@ class VirtualMachineSecrets(ComputeSecrets): All required parameters must be populated in order to send to Azure. - :param compute_type: Required. Constant filled by server. - :type compute_type: str + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType :param administrator_account: Admin credentials for virtual machine. :type administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials @@ -1734,48 +3220,51 @@ class VirtualMachineSecrets(ComputeSecrets): 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(VirtualMachineSecrets, self).__init__(**kwargs) + self.compute_type = 'VirtualMachine' # type: str self.administrator_account = kwargs.get('administrator_account', None) - self.compute_type = 'VirtualMachine' -class VirtualMachineSize(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Virtual Machine size name. The name of the virtual machine - size. + :ivar name: The name of the virtual machine size. :vartype name: str - :ivar family: Virtual Machine family name. The family name of the virtual - machine size. + :ivar family: The family name of the virtual machine size. :vartype family: str - :ivar v_cp_us: Number of vPUs. The number of vCPUs supported by the - virtual machine size. + :ivar v_cp_us: The number of vCPUs supported by the virtual machine size. :vartype v_cp_us: int - :ivar os_vhd_size_mb: OS VHD Disk size. The OS VHD disk size, in MB, - allowed by the virtual machine size. + :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: Resource volume size. The resource volume - size, in MB, allowed by the virtual machine size. + :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: Memory size. The amount of memory, in GB, supported by - the virtual machine size. + :ivar memory_gb: The amount of memory, in GB, supported by the virtual machine size. :vartype memory_gb: float - :ivar low_priority_capable: Low priority capable. Specifies if the virtual - machine size supports low priority VMs. + :ivar low_priority_capable: Specifies if the virtual machine size supports low priority VMs. :vartype low_priority_capable: bool - :ivar premium_io: Premium IO supported. Specifies if the virtual machine - size supports premium IO. + :ivar premium_io: Specifies if the virtual machine size supports premium IO. :vartype premium_io: bool + :param estimated_vm_prices: The estimated price information for using a VM. + :type estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices + :param supported_compute_types: Specifies the compute types supported by the virtual machine + size. + :type 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}, @@ -1787,53 +3276,63 @@ class VirtualMachineSize(Model): '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): + def __init__( + self, + **kwargs + ): 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(Model): +class VirtualMachineSizeListResult(msrest.serialization.Model): """The List Virtual Machine size operation response. - :param aml_compute: The list of virtual machine sizes supported by - AmlCompute. - :type aml_compute: - list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] + :param aml_compute: The list of virtual machine sizes supported by AmlCompute. + :type aml_compute: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] """ _attribute_map = { 'aml_compute': {'key': 'amlCompute', 'type': '[VirtualMachineSize]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(VirtualMachineSizeListResult, self).__init__(**kwargs) self.aml_compute = kwargs.get('aml_compute', None) -class VirtualMachineSshCredentials(Model): +class VirtualMachineSshCredentials(msrest.serialization.Model): """Admin credentials for virtual machine. - :param username: Username of admin account + :param username: Username of admin account. :type username: str - :param password: Password of admin account + :param password: Password of admin account. :type password: str - :param public_key_data: Public key data + :param public_key_data: Public key data. :type public_key_data: str - :param private_key_data: Private key data + :param private_key_data: Private key data. :type private_key_data: str """ @@ -1844,7 +3343,10 @@ class VirtualMachineSshCredentials(Model): 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(VirtualMachineSshCredentials, self).__init__(**kwargs) self.username = kwargs.get('username', None) self.password = kwargs.get('password', None) @@ -1855,64 +3357,87 @@ def __init__(self, **kwargs): 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. + 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 name: Specifies the name of the resource. :vartype name: str - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.Identity + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.machinelearningservices.models.Identity :param location: Specifies the location of the resource. :type location: str :ivar type: Specifies the type of the resource. :vartype type: str - :param tags: Contains resource tags defined as key/value pairs. + :param tags: A set of tags. Contains resource tags defined as key/value pairs. :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku :ivar workspace_id: The immutable id associated with this workspace. :vartype workspace_id: str :param description: The description of this workspace. :type description: str - :param friendly_name: The friendly name for this workspace. This name in - mutable + :param friendly_name: The friendly name for this workspace. This name in mutable. :type friendly_name: str - :ivar creation_time: The creation time of the machine learning workspace - in ISO8601 format. - :vartype creation_time: datetime - :param key_vault: ARM id of the key vault associated with this workspace. - This cannot be changed once the workspace has been created + :ivar creation_time: The creation time of the machine learning workspace in ISO8601 format. + :vartype creation_time: ~datetime.datetime + :param key_vault: ARM id of the key vault associated with this workspace. This cannot be + changed once the workspace has been created. :type key_vault: str - :param application_insights: ARM id of the application insights associated - with this workspace. This cannot be changed once the workspace has been - created + :param application_insights: ARM id of the application insights associated with this workspace. + This cannot be changed once the workspace has been created. :type application_insights: str - :param container_registry: ARM id of the container registry associated - with this workspace. This cannot be changed once the workspace has been - created + :param container_registry: ARM id of the container registry associated with this workspace. + This cannot be changed once the workspace has been created. :type container_registry: str - :param storage_account: ARM id of the storage account associated with this - workspace. This cannot be changed once the workspace has been created + :param storage_account: ARM id of the storage account associated with this workspace. This + cannot be changed once the workspace has been created. :type storage_account: str - :param discovery_url: Url for the discovery service to identify regional - endpoints for machine learning experimentation services + :param discovery_url: Url for the discovery service to identify regional endpoints for machine + learning experimentation services. :type 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' + :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 + :param encryption: The encryption settings of Azure ML workspace. + :type encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty + :param hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data + collected by the service. + :type 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 + :param image_build_compute: The compute name for image build. + :type image_build_compute: str + :param allow_public_access_when_behind_vnet: The flag to indicate whether to allow public + access when behind VNet. + :type allow_public_access_when_behind_vnet: bool + :ivar private_endpoint_connections: The list of private endpoint connections in the workspace. + :vartype private_endpoint_connections: + list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] + :param shared_private_link_resources: The list of shared private link resources in this + workspace. + :type 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 """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, - 'identity': {'readonly': True}, 'type': {'readonly': True}, 'workspace_id': {'readonly': True}, 'creation_time': {'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}, } _attribute_map = { @@ -1922,6 +3447,7 @@ class Workspace(Resource): 'location': {'key': 'location', 'type': 'str'}, 'type': {'key': 'type', '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'}, @@ -1932,9 +3458,21 @@ class Workspace(Resource): 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__(self, **kwargs): + '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'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, + 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, + } + + def __init__( + self, + **kwargs + ): super(Workspace, self).__init__(**kwargs) self.workspace_id = None self.description = kwargs.get('description', None) @@ -1946,13 +3484,165 @@ def __init__(self, **kwargs): 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.private_endpoint_connections = None + self.shared_private_link_resources = kwargs.get('shared_private_link_resources', None) + self.notebook_info = None + + +class WorkspaceConnection(msrest.serialization.Model): + """Workspace connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: ResourceId of the workspace connection. + :vartype id: str + :ivar name: Friendly name of the workspace connection. + :vartype name: str + :ivar type: Resource type of workspace connection. + :vartype type: str + :param category: Category of the workspace connection. + :type category: str + :param target: Target of the workspace connection. + :type target: str + :param auth_type: Authorization type of the workspace connection. + :type auth_type: str + :param value: Value details of the workspace connection. + :type value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'target': {'key': 'properties.target', 'type': 'str'}, + 'auth_type': {'key': 'properties.authType', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkspaceConnection, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.category = kwargs.get('category', None) + self.target = kwargs.get('target', None) + self.auth_type = kwargs.get('auth_type', None) + self.value = kwargs.get('value', None) + + +class WorkspaceConnectionDto(msrest.serialization.Model): + """object used for creating workspace connection. + + :param name: Friendly name of the workspace connection. + :type name: str + :param category: Category of the workspace connection. + :type category: str + :param target: Target of the workspace connection. + :type target: str + :param auth_type: Authorization type of the workspace connection. + :type auth_type: str + :param value: Value details of the workspace connection. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'target': {'key': 'properties.target', 'type': 'str'}, + 'auth_type': {'key': 'properties.authType', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkspaceConnectionDto, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.category = kwargs.get('category', None) + self.target = kwargs.get('target', None) + self.auth_type = kwargs.get('auth_type', None) + self.value = kwargs.get('value', None) + + +class WorkspaceListResult(msrest.serialization.Model): + """The result of a request to list machine learning workspaces. + + :param 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. + :type value: list[~azure.mgmt.machinelearningservices.models.Workspace] + :param next_link: The URI that can be used to request the next list of machine learning + workspaces. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Workspace]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkspaceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class WorkspaceSku(msrest.serialization.Model): + """AML workspace sku information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: + :vartype resource_type: str + :ivar skus: The list of workspace sku settings. + :vartype skus: list[~azure.mgmt.machinelearningservices.models.SkuSettings] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'skus': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'skus': {'key': 'skus', 'type': '[SkuSettings]'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkspaceSku, self).__init__(**kwargs) + self.resource_type = None + self.skus = None -class WorkspaceUpdateParameters(Model): +class WorkspaceUpdateParameters(msrest.serialization.Model): """The parameters for updating a machine learning workspace. - :param tags: The resource tags for the machine learning workspace. + :param tags: A set of tags. The resource tags for the machine learning workspace. :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku :param description: The description of this workspace. :type description: str :param friendly_name: The friendly name for this workspace. @@ -1961,12 +3651,17 @@ class WorkspaceUpdateParameters(Model): _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(WorkspaceUpdateParameters, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) self.description = kwargs.get('description', None) self.friendly_name = kwargs.get('friendly_name', None) diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models_py3.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models_py3.py index f173a48382ad..8abd97a8cef0 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models_py3.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models_py3.py @@ -1,67 +1,68 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +import datetime +from typing import Dict, List, Optional, Union +from azure.core.exceptions import HttpResponseError +import msrest.serialization -class Compute(Model): +from ._azure_machine_learning_workspaces_enums import * + + +class Compute(msrest.serialization.Model): """Machine Learning compute object. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AKS, AmlCompute, VirtualMachine, HDInsight, DataFactory, - Databricks, DataLakeAnalytics + sub-classes are: AKS, AmlCompute, ComputeInstance, DataFactory, DataLakeAnalytics, Databricks, HDInsight, VirtualMachine. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param compute_location: Location for the underlying compute + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. :type 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' + :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 :param description: The description of the Machine Learning compute. :type description: str :ivar created_on: The date and time when the compute was created. - :vartype created_on: datetime + :vartype created_on: ~datetime.datetime :ivar modified_on: The date and time when the compute was last modified. - :vartype modified_on: datetime - :param resource_id: ARM resource id of the underlying compute + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. :type resource_id: str - :ivar provisioning_errors: Errors during provisioning + :ivar provisioning_errors: Errors during provisioning. :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] - :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. + :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 - :param compute_type: Required. Constant filled by server. - :type compute_type: str """ _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}, - 'compute_type': {'required': 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'}, @@ -70,15 +71,22 @@ class Compute(Model): 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[MachineLearningServiceError]'}, 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, } _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'VirtualMachine': 'VirtualMachine', 'HDInsight': 'HDInsight', 'DataFactory': 'DataFactory', 'Databricks': 'Databricks', 'DataLakeAnalytics': 'DataLakeAnalytics'} + 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'VirtualMachine': 'VirtualMachine'} } - def __init__(self, *, compute_location: str=None, description: str=None, resource_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + compute_location: Optional[str] = None, + description: Optional[str] = None, + resource_id: Optional[str] = None, + **kwargs + ): super(Compute, self).__init__(**kwargs) + self.compute_type = None # type: Optional[str] self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -87,56 +95,55 @@ def __init__(self, *, compute_location: str=None, description: str=None, resourc self.resource_id = resource_id self.provisioning_errors = None self.is_attached_compute = None - self.compute_type = None class AKS(Compute): """A Machine Learning compute based on AKS. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param compute_location: Location for the underlying compute + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. :type 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' + :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 :param description: The description of the Machine Learning compute. :type description: str :ivar created_on: The date and time when the compute was created. - :vartype created_on: datetime + :vartype created_on: ~datetime.datetime :ivar modified_on: The date and time when the compute was last modified. - :vartype modified_on: datetime - :param resource_id: ARM resource id of the underlying compute + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. :type resource_id: str - :ivar provisioning_errors: Errors during provisioning + :ivar provisioning_errors: Errors during provisioning. :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] - :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. + :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 - :param compute_type: Required. Constant filled by server. - :type compute_type: str - :param properties: AKS properties + :param properties: AKS properties. :type properties: ~azure.mgmt.machinelearningservices.models.AKSProperties """ _validation = { + 'compute_type': {'required': True}, 'provisioning_state': {'readonly': True}, 'created_on': {'readonly': True}, 'modified_on': {'readonly': True}, 'provisioning_errors': {'readonly': True}, 'is_attached_compute': {'readonly': True}, - 'compute_type': {'required': 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'}, @@ -145,28 +152,35 @@ class AKS(Compute): 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[MachineLearningServiceError]'}, 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'AKSProperties'}, } - def __init__(self, *, compute_location: str=None, description: str=None, resource_id: str=None, properties=None, **kwargs) -> None: + def __init__( + self, + *, + compute_location: Optional[str] = None, + description: Optional[str] = None, + resource_id: Optional[str] = None, + properties: Optional["AKSProperties"] = None, + **kwargs + ): super(AKS, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, **kwargs) + self.compute_type = 'AKS' # type: str self.properties = properties - self.compute_type = 'AKS' -class ComputeSecrets(Model): - """Secrets related to a Machine Learning compute. Might differ for every type - of compute. +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, VirtualMachineSecrets, - DatabricksComputeSecrets + sub-classes are: AksComputeSecrets, DatabricksComputeSecrets, VirtualMachineSecrets. All required parameters must be populated in order to send to Azure. - :param compute_type: Required. Constant filled by server. - :type compute_type: str + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType """ _validation = { @@ -178,12 +192,15 @@ class ComputeSecrets(Model): } _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets', 'Databricks': 'DatabricksComputeSecrets'} + 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(ComputeSecrets, self).__init__(**kwargs) - self.compute_type = None + self.compute_type = None # type: Optional[str] class AksComputeSecrets(ComputeSecrets): @@ -191,13 +208,15 @@ class AksComputeSecrets(ComputeSecrets): All required parameters must be populated in order to send to Azure. - :param compute_type: Required. Constant filled by server. - :type compute_type: str - :param user_kube_config: Content of kubeconfig file that can be used to - connect to the Kubernetes cluster. + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param user_kube_config: Content of kubeconfig file that can be used to connect to the + Kubernetes cluster. :type user_kube_config: str - :param admin_kube_config: Content of kubeconfig file that can be used to - connect to the Kubernetes cluster. + :param admin_kube_config: Content of kubeconfig file that can be used to connect to the + Kubernetes cluster. :type admin_kube_config: str :param image_pull_secret_name: Image registry pull secret. :type image_pull_secret_name: str @@ -214,30 +233,34 @@ class AksComputeSecrets(ComputeSecrets): 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, } - def __init__(self, *, user_kube_config: str=None, admin_kube_config: str=None, image_pull_secret_name: str=None, **kwargs) -> None: + def __init__( + self, + *, + user_kube_config: Optional[str] = None, + admin_kube_config: Optional[str] = None, + image_pull_secret_name: Optional[str] = None, + **kwargs + ): super(AksComputeSecrets, self).__init__(**kwargs) + self.compute_type = 'AKS' # type: str 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' -class AksNetworkingConfiguration(Model): +class AksNetworkingConfiguration(msrest.serialization.Model): """Advance configuration for AKS networking. - :param subnet_id: Virtual network subnet resource ID the compute nodes - belong to + :param subnet_id: Virtual network subnet resource ID the compute nodes belong to. :type subnet_id: str - :param service_cidr: A CIDR notation IP range from which to assign service - cluster IPs. It must not overlap with any Subnet IP ranges. + :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + not overlap with any Subnet IP ranges. :type service_cidr: str - :param dns_service_ip: An IP address assigned to the Kubernetes DNS - service. It must be within the Kubernetes service address range specified - in serviceCidr. + :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + the Kubernetes service address range specified in serviceCidr. :type dns_service_ip: str - :param 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. + :param 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. :type docker_bridge_cidr: str """ @@ -254,7 +277,15 @@ class AksNetworkingConfiguration(Model): 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, } - def __init__(self, *, subnet_id: str=None, service_cidr: str=None, dns_service_ip: str=None, docker_bridge_cidr: str=None, **kwargs) -> None: + 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 + ): super(AksNetworkingConfiguration, self).__init__(**kwargs) self.subnet_id = subnet_id self.service_cidr = service_cidr @@ -262,25 +293,22 @@ def __init__(self, *, subnet_id: str=None, service_cidr: str=None, dns_service_i self.docker_bridge_cidr = docker_bridge_cidr -class AKSProperties(Model): +class AKSProperties(msrest.serialization.Model): """AKS properties. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :param cluster_fqdn: Cluster full qualified domain name + :param cluster_fqdn: Cluster full qualified domain name. :type cluster_fqdn: str - :ivar system_services: System services - :vartype system_services: - list[~azure.mgmt.machinelearningservices.models.SystemService] - :param agent_count: Number of agents + :ivar system_services: System services. + :vartype system_services: list[~azure.mgmt.machinelearningservices.models.SystemService] + :param agent_count: Number of agents. :type agent_count: int - :param agent_vm_size: Agent virtual machine size + :param agent_vm_size: Agent virtual machine size. :type agent_vm_size: str - :param ssl_configuration: SSL configuration - :type ssl_configuration: - ~azure.mgmt.machinelearningservices.models.SslConfiguration - :param aks_networking_configuration: AKS networking configuration for vnet + :param ssl_configuration: SSL configuration. + :type ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration + :param aks_networking_configuration: AKS networking configuration for vnet. :type aks_networking_configuration: ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration """ @@ -299,7 +327,16 @@ class AKSProperties(Model): 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, } - def __init__(self, *, cluster_fqdn: str=None, agent_count: int=None, agent_vm_size: str=None, ssl_configuration=None, aks_networking_configuration=None, **kwargs) -> None: + def __init__( + self, + *, + cluster_fqdn: Optional[str] = None, + agent_count: Optional[int] = None, + agent_vm_size: Optional[str] = None, + ssl_configuration: Optional["SslConfiguration"] = None, + aks_networking_configuration: Optional["AksNetworkingConfiguration"] = None, + **kwargs + ): super(AKSProperties, self).__init__(**kwargs) self.cluster_fqdn = cluster_fqdn self.system_services = None @@ -312,51 +349,50 @@ def __init__(self, *, cluster_fqdn: str=None, agent_count: int=None, agent_vm_si class AmlCompute(Compute): """An Azure Machine Learning compute. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param compute_location: Location for the underlying compute + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. :type 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' + :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 :param description: The description of the Machine Learning compute. :type description: str :ivar created_on: The date and time when the compute was created. - :vartype created_on: datetime + :vartype created_on: ~datetime.datetime :ivar modified_on: The date and time when the compute was last modified. - :vartype modified_on: datetime - :param resource_id: ARM resource id of the underlying compute + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. :type resource_id: str - :ivar provisioning_errors: Errors during provisioning + :ivar provisioning_errors: Errors during provisioning. :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] - :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. + :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 - :param compute_type: Required. Constant filled by server. - :type compute_type: str - :param properties: AML Compute properties - :type properties: - ~azure.mgmt.machinelearningservices.models.AmlComputeProperties + :param properties: AML Compute properties. + :type properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties """ _validation = { + 'compute_type': {'required': True}, 'provisioning_state': {'readonly': True}, 'created_on': {'readonly': True}, 'modified_on': {'readonly': True}, 'provisioning_errors': {'readonly': True}, 'is_attached_compute': {'readonly': True}, - 'compute_type': {'required': 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'}, @@ -365,174 +401,202 @@ class AmlCompute(Compute): 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[MachineLearningServiceError]'}, 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, } - def __init__(self, *, compute_location: str=None, description: str=None, resource_id: str=None, properties=None, **kwargs) -> None: + def __init__( + self, + *, + compute_location: Optional[str] = None, + description: Optional[str] = None, + resource_id: Optional[str] = None, + properties: Optional["AmlComputeProperties"] = None, + **kwargs + ): super(AmlCompute, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, **kwargs) + self.compute_type = 'AmlCompute' # type: str self.properties = properties - self.compute_type = 'AmlCompute' -class AmlComputeNodeInformation(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar node_id: Node ID. ID of the compute node. + :ivar node_id: ID of the compute node. :vartype node_id: str - :ivar ip_address: IP address. Public IP address of the compute node. - :vartype ip_address: str - :ivar port: Port. SSH port number of the node. - :vartype port: float + :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}, - 'ip_address': {'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'}, - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'float'}, + '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) -> None: + def __init__( + self, + **kwargs + ): super(AmlComputeNodeInformation, self).__init__(**kwargs) self.node_id = None - self.ip_address = None + self.private_ip_address = None + self.public_ip_address = None self.port = None + self.node_state = None + self.run_id = None -class ComputeNodesInformation(Model): - """Compute nodes information related to a Machine Learning compute. Might - differ for every type of compute. +class ComputeNodesInformation(msrest.serialization.Model): + """Compute nodes information 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: AmlComputeNodesInformation + sub-classes are: AmlComputeNodesInformation. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType :ivar next_link: The continuation token. :vartype next_link: str - :param compute_type: Required. Constant filled by server. - :type compute_type: str """ _validation = { - 'next_link': {'readonly': True}, 'compute_type': {'required': True}, + 'next_link': {'readonly': True}, } _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, 'compute_type': {'key': 'computeType', 'type': 'str'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } _subtype_map = { 'compute_type': {'AmlCompute': 'AmlComputeNodesInformation'} } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(ComputeNodesInformation, self).__init__(**kwargs) + self.compute_type = None # type: Optional[str] self.next_link = None - self.compute_type = None class AmlComputeNodesInformation(ComputeNodesInformation): """Compute node information related to a AmlCompute. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType :ivar next_link: The continuation token. :vartype next_link: str - :param compute_type: Required. Constant filled by server. - :type compute_type: str :ivar nodes: The collection of returned AmlCompute nodes details. - :vartype nodes: - list[~azure.mgmt.machinelearningservices.models.AmlComputeNodeInformation] + :vartype nodes: list[~azure.mgmt.machinelearningservices.models.AmlComputeNodeInformation] """ _validation = { - 'next_link': {'readonly': True}, 'compute_type': {'required': True}, + 'next_link': {'readonly': True}, 'nodes': {'readonly': True}, } _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, 'compute_type': {'key': 'computeType', 'type': 'str'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(AmlComputeNodesInformation, self).__init__(**kwargs) + self.compute_type = 'AmlCompute' # type: str self.nodes = None - self.compute_type = 'AmlCompute' -class AmlComputeProperties(Model): +class AmlComputeProperties(msrest.serialization.Model): """AML Compute properties. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :param vm_size: Virtual Machine Size + :param vm_size: Virtual Machine Size. :type vm_size: str - :param vm_priority: Virtual Machine priority. Possible values include: - 'Dedicated', 'LowPriority' - :type vm_priority: str or - ~azure.mgmt.machinelearningservices.models.VmPriority - :param scale_settings: Scale settings for AML Compute - :type scale_settings: - ~azure.mgmt.machinelearningservices.models.ScaleSettings - :param user_account_credentials: User account credentials. Credentials for - an administrator user account that will be created on each compute node. + :param vm_priority: Virtual Machine priority. Possible values include: "Dedicated", + "LowPriority". + :type vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority + :param scale_settings: Scale settings for AML Compute. + :type scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings + :param user_account_credentials: Credentials for an administrator user account that will be + created on each compute node. :type user_account_credentials: ~azure.mgmt.machinelearningservices.models.UserAccountCredentials - :param subnet: Subnet. Virtual network subnet resource ID the compute - nodes belong to. + :param subnet: Virtual network subnet resource ID the compute nodes belong to. :type subnet: ~azure.mgmt.machinelearningservices.models.ResourceId - :ivar allocation_state: 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: Allocation state transition time. - The time at which the compute entered its current allocation state. - :vartype allocation_state_transition_time: datetime - :ivar errors: Errors. Collection of errors encountered by various compute - nodes during node setup. - :vartype errors: - list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] - :ivar current_node_count: Current node count. The number of compute nodes - currently assigned to the compute. + :param 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". + :type 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.MachineLearningServiceError] + :ivar current_node_count: The number of compute nodes currently assigned to the compute. :vartype current_node_count: int - :ivar target_node_count: 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 + :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: Node state counts. Counts of various node states - on the compute. - :vartype node_state_counts: - ~azure.mgmt.machinelearningservices.models.NodeStateCounts + :ivar node_state_counts: Counts of various node states on the compute. + :vartype node_state_counts: ~azure.mgmt.machinelearningservices.models.NodeStateCounts """ _validation = { @@ -550,6 +614,7 @@ class AmlComputeProperties(Model): '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': '[MachineLearningServiceError]'}, @@ -558,13 +623,24 @@ class AmlComputeProperties(Model): 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, } - def __init__(self, *, vm_size: str=None, vm_priority=None, scale_settings=None, user_account_credentials=None, subnet=None, **kwargs) -> None: + def __init__( + self, + *, + vm_size: Optional[str] = None, + vm_priority: Optional[Union[str, "VmPriority"]] = 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", + **kwargs + ): super(AmlComputeProperties, self).__init__(**kwargs) self.vm_size = vm_size self.vm_priority = vm_priority 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 @@ -573,56 +649,437 @@ def __init__(self, *, vm_size: str=None, vm_priority=None, scale_settings=None, self.node_state_counts = None -class CloudError(Model): - """CloudError. +class AmlUserFeature(msrest.serialization.Model): + """Features enabled for a workspace. + + :param id: Specifies the feature ID. + :type id: str + :param display_name: Specifies the feature name. + :type display_name: str + :param description: Describes the feature for user experience. + :type 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 + ): + super(AmlUserFeature, self).__init__(**kwargs) + self.id = id + self.display_name = display_name + self.description = description -class ClusterUpdateParameters(Model): + +class ClusterUpdateParameters(msrest.serialization.Model): """AmlCompute update parameters. - :param scale_settings: Scale settings. Desired scale settings for the - amlCompute. - :type scale_settings: - ~azure.mgmt.machinelearningservices.models.ScaleSettings + :param scale_settings: Desired scale settings for the amlCompute. + :type scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings """ _attribute_map = { 'scale_settings': {'key': 'properties.scaleSettings', 'type': 'ScaleSettings'}, } - def __init__(self, *, scale_settings=None, **kwargs) -> None: + def __init__( + self, + *, + scale_settings: Optional["ScaleSettings"] = None, + **kwargs + ): super(ClusterUpdateParameters, self).__init__(**kwargs) self.scale_settings = scale_settings -class Resource(Model): +class ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user 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(ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class ComputeInstance(Compute): + """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. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. + :type 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 + :param description: The description of the Machine Learning compute. + :type description: str + :ivar created_on: The date and time when the compute was created. + :vartype created_on: ~datetime.datetime + :ivar modified_on: The date and time when the compute was last modified. + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. + :type resource_id: str + :ivar provisioning_errors: Errors during provisioning. + :vartype provisioning_errors: + list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :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 + :param properties: Compute Instance properties. + :type properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties + """ + + _validation = { + 'compute_type': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'created_on': {'readonly': True}, + 'modified_on': {'readonly': True}, + 'provisioning_errors': {'readonly': True}, + 'is_attached_compute': {'readonly': True}, + } + + _attribute_map = { + 'compute_type': {'key': 'computeType', 'type': 'str'}, + 'compute_location': {'key': 'computeLocation', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, + 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[MachineLearningServiceError]'}, + 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, + 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, + } + + def __init__( + self, + *, + compute_location: Optional[str] = None, + description: Optional[str] = None, + resource_id: Optional[str] = None, + properties: Optional["ComputeInstanceProperties"] = None, + **kwargs + ): + super(ComputeInstance, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, **kwargs) + self.compute_type = 'ComputeInstance' # type: str + self.properties = properties + + +class ComputeInstanceApplication(msrest.serialization.Model): + """Defines an Aml Instance application and its connectivity endpoint URI. + + :param display_name: Name of the ComputeInstance application. + :type display_name: str + :param endpoint_uri: Application' endpoint URI. + :type 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 + ): + super(ComputeInstanceApplication, self).__init__(**kwargs) + self.display_name = display_name + self.endpoint_uri = endpoint_uri + + +class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): + """Defines all connectivity endpoints and properties for a ComputeInstance. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar public_ip_address: Public IP Address of this ComputeInstance. + :vartype public_ip_address: str + :ivar private_ip_address: Private IP Address of this ComputeInstance (local to the VNET in + which the compute instance is deployed). + :vartype private_ip_address: str + """ + + _validation = { + 'public_ip_address': {'readonly': True}, + 'private_ip_address': {'readonly': True}, + } + + _attribute_map = { + 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) + self.public_ip_address = None + self.private_ip_address = None + + +class ComputeInstanceCreatedBy(msrest.serialization.Model): + """Describes information on user who created this ComputeInstance. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar user_name: Name of the user. + :vartype user_name: str + :ivar user_org_id: Uniquely identifies user' Azure Active Directory organization. + :vartype user_org_id: str + :ivar user_id: Uniquely identifies the user within his/her organization. + :vartype user_id: str + """ + + _validation = { + 'user_name': {'readonly': True}, + 'user_org_id': {'readonly': True}, + 'user_id': {'readonly': True}, + } + + _attribute_map = { + 'user_name': {'key': 'userName', 'type': 'str'}, + 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, + 'user_id': {'key': 'userId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ComputeInstanceCreatedBy, self).__init__(**kwargs) + self.user_name = None + self.user_org_id = None + self.user_id = None + + +class ComputeInstanceLastOperation(msrest.serialization.Model): + """The last operation on ComputeInstance. + + :param operation_name: Name of the last operation. Possible values include: "Create", "Start", + "Stop", "Restart", "Reimage", "Delete". + :type operation_name: str or ~azure.mgmt.machinelearningservices.models.OperationName + :param operation_time: Time of the last operation. + :type operation_time: ~datetime.datetime + :param operation_status: Operation status. Possible values include: "InProgress", "Succeeded", + "CreateFailed", "StartFailed", "StopFailed", "RestartFailed", "ReimageFailed", "DeleteFailed". + :type operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus + """ + + _attribute_map = { + 'operation_name': {'key': 'operationName', 'type': 'str'}, + 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, + 'operation_status': {'key': 'operationStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + operation_name: Optional[Union[str, "OperationName"]] = None, + operation_time: Optional[datetime.datetime] = None, + operation_status: Optional[Union[str, "OperationStatus"]] = None, + **kwargs + ): + super(ComputeInstanceLastOperation, self).__init__(**kwargs) + self.operation_name = operation_name + self.operation_time = operation_time + self.operation_status = operation_status + + +class ComputeInstanceProperties(msrest.serialization.Model): + """Compute Instance properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param vm_size: Virtual Machine Size. + :type vm_size: str + :param subnet: Virtual network subnet resource ID the compute nodes belong to. + :type subnet: ~azure.mgmt.machinelearningservices.models.ResourceId + :param 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". + :type application_sharing_policy: str or + ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy + :param ssh_settings: Specifies policy and settings for SSH access. + :type ssh_settings: ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings + :ivar connectivity_endpoints: Describes all connectivity endpoints available for this + ComputeInstance. + :vartype connectivity_endpoints: + ~azure.mgmt.machinelearningservices.models.ComputeInstanceConnectivityEndpoints + :ivar applications: Describes available applications and their endpoints on this + ComputeInstance. + :vartype applications: + list[~azure.mgmt.machinelearningservices.models.ComputeInstanceApplication] + :ivar created_by: Describes information on user who created this ComputeInstance. + :vartype created_by: ~azure.mgmt.machinelearningservices.models.ComputeInstanceCreatedBy + :ivar errors: Collection of errors encountered on this ComputeInstance. + :vartype errors: list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :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 last_operation: The last operation on ComputeInstance. + :vartype last_operation: + ~azure.mgmt.machinelearningservices.models.ComputeInstanceLastOperation + """ + + _validation = { + 'connectivity_endpoints': {'readonly': True}, + 'applications': {'readonly': True}, + 'created_by': {'readonly': True}, + 'errors': {'readonly': True}, + 'state': {'readonly': True}, + 'last_operation': {'readonly': True}, + } + + _attribute_map = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, + 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, + 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, + 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, + 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, + 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, + 'errors': {'key': 'errors', 'type': '[MachineLearningServiceError]'}, + 'state': {'key': 'state', 'type': 'str'}, + 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, + } + + def __init__( + self, + *, + vm_size: Optional[str] = None, + subnet: Optional["ResourceId"] = None, + application_sharing_policy: Optional[Union[str, "ApplicationSharingPolicy"]] = "Shared", + ssh_settings: Optional["ComputeInstanceSshSettings"] = None, + **kwargs + ): + super(ComputeInstanceProperties, self).__init__(**kwargs) + self.vm_size = vm_size + self.subnet = subnet + self.application_sharing_policy = application_sharing_policy + self.ssh_settings = ssh_settings + self.connectivity_endpoints = None + self.applications = None + self.created_by = None + self.errors = None + self.state = None + self.last_operation = 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. + + :param 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". + :type 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 + :param 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. + :type 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 + ): + super(ComputeInstanceSshSettings, self).__init__(**kwargs) + self.ssh_public_access = ssh_public_access + self.admin_user_name = None + self.ssh_port = None + self.admin_public_key = admin_public_key + + +class Resource(msrest.serialization.Model): """Azure Resource Manager resource envelope. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 name: Specifies the name of the resource. :vartype name: str - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.Identity + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.machinelearningservices.models.Identity :param location: Specifies the location of the resource. :type location: str :ivar type: Specifies the type of the resource. :vartype type: str - :param tags: Contains resource tags defined as key/value pairs. + :param tags: A set of tags. Contains resource tags defined as key/value pairs. :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, - 'identity': {'readonly': True}, 'type': {'readonly': True}, } @@ -633,44 +1090,54 @@ class Resource(Model): 'location': {'key': 'location', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__( + self, + *, + identity: Optional["Identity"] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None - self.identity = None + self.identity = identity self.location = location self.type = None self.tags = tags + self.sku = sku class ComputeResource(Resource): """Machine Learning compute object wrapped into ARM resource envelope. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 name: Specifies the name of the resource. :vartype name: str - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.Identity + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.machinelearningservices.models.Identity :param location: Specifies the location of the resource. :type location: str :ivar type: Specifies the type of the resource. :vartype type: str - :param tags: Contains resource tags defined as key/value pairs. + :param tags: A set of tags. Contains resource tags defined as key/value pairs. :type tags: dict[str, str] - :param properties: Compute properties + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :param properties: Compute properties. :type properties: ~azure.mgmt.machinelearningservices.models.Compute """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, - 'identity': {'readonly': True}, 'type': {'readonly': True}, } @@ -681,62 +1148,71 @@ class ComputeResource(Resource): 'location': {'key': 'location', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, 'properties': {'key': 'properties', 'type': 'Compute'}, } - def __init__(self, *, location: str=None, tags=None, properties=None, **kwargs) -> None: - super(ComputeResource, self).__init__(location=location, tags=tags, **kwargs) + def __init__( + self, + *, + identity: Optional["Identity"] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + properties: Optional["Compute"] = None, + **kwargs + ): + super(ComputeResource, self).__init__(identity=identity, location=location, tags=tags, sku=sku, **kwargs) self.properties = properties class Databricks(Compute): """A DataFactory compute. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param compute_location: Location for the underlying compute + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. :type 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' + :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 :param description: The description of the Machine Learning compute. :type description: str :ivar created_on: The date and time when the compute was created. - :vartype created_on: datetime + :vartype created_on: ~datetime.datetime :ivar modified_on: The date and time when the compute was last modified. - :vartype modified_on: datetime - :param resource_id: ARM resource id of the underlying compute + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. :type resource_id: str - :ivar provisioning_errors: Errors during provisioning + :ivar provisioning_errors: Errors during provisioning. :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] - :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. + :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 - :param compute_type: Required. Constant filled by server. - :type compute_type: str :param properties: - :type properties: - ~azure.mgmt.machinelearningservices.models.DatabricksProperties + :type properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties """ _validation = { + 'compute_type': {'required': True}, 'provisioning_state': {'readonly': True}, 'created_on': {'readonly': True}, 'modified_on': {'readonly': True}, 'provisioning_errors': {'readonly': True}, 'is_attached_compute': {'readonly': True}, - 'compute_type': {'required': 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'}, @@ -745,14 +1221,21 @@ class Databricks(Compute): 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[MachineLearningServiceError]'}, 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, } - def __init__(self, *, compute_location: str=None, description: str=None, resource_id: str=None, properties=None, **kwargs) -> None: + def __init__( + self, + *, + compute_location: Optional[str] = None, + description: Optional[str] = None, + resource_id: Optional[str] = None, + properties: Optional["DatabricksProperties"] = None, + **kwargs + ): super(Databricks, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, **kwargs) + self.compute_type = 'Databricks' # type: str self.properties = properties - self.compute_type = 'Databricks' class DatabricksComputeSecrets(ComputeSecrets): @@ -760,8 +1243,10 @@ class DatabricksComputeSecrets(ComputeSecrets): All required parameters must be populated in order to send to Azure. - :param compute_type: Required. Constant filled by server. - :type compute_type: str + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType :param databricks_access_token: access token for databricks account. :type databricks_access_token: str """ @@ -775,16 +1260,21 @@ class DatabricksComputeSecrets(ComputeSecrets): 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, } - def __init__(self, *, databricks_access_token: str=None, **kwargs) -> None: + def __init__( + self, + *, + databricks_access_token: Optional[str] = None, + **kwargs + ): super(DatabricksComputeSecrets, self).__init__(**kwargs) + self.compute_type = 'Databricks' # type: str self.databricks_access_token = databricks_access_token - self.compute_type = 'Databricks' -class DatabricksProperties(Model): +class DatabricksProperties(msrest.serialization.Model): """DatabricksProperties. - :param databricks_access_token: Databricks access token + :param databricks_access_token: Databricks access token. :type databricks_access_token: str """ @@ -792,7 +1282,12 @@ class DatabricksProperties(Model): 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, } - def __init__(self, *, databricks_access_token: str=None, **kwargs) -> None: + def __init__( + self, + *, + databricks_access_token: Optional[str] = None, + **kwargs + ): super(DatabricksProperties, self).__init__(**kwargs) self.databricks_access_token = databricks_access_token @@ -800,48 +1295,48 @@ def __init__(self, *, databricks_access_token: str=None, **kwargs) -> None: class DataFactory(Compute): """A DataFactory compute. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param compute_location: Location for the underlying compute + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. :type 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' + :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 :param description: The description of the Machine Learning compute. :type description: str :ivar created_on: The date and time when the compute was created. - :vartype created_on: datetime + :vartype created_on: ~datetime.datetime :ivar modified_on: The date and time when the compute was last modified. - :vartype modified_on: datetime - :param resource_id: ARM resource id of the underlying compute + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. :type resource_id: str - :ivar provisioning_errors: Errors during provisioning + :ivar provisioning_errors: Errors during provisioning. :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] - :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. + :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 - :param compute_type: Required. Constant filled by server. - :type compute_type: str """ _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}, - 'compute_type': {'required': 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'}, @@ -850,62 +1345,67 @@ class DataFactory(Compute): 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[MachineLearningServiceError]'}, 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, } - def __init__(self, *, compute_location: str=None, description: str=None, resource_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + compute_location: Optional[str] = None, + description: Optional[str] = None, + resource_id: Optional[str] = None, + **kwargs + ): super(DataFactory, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, **kwargs) - self.compute_type = 'DataFactory' + self.compute_type = 'DataFactory' # type: str class DataLakeAnalytics(Compute): """A DataLakeAnalytics compute. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param compute_location: Location for the underlying compute + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. :type 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' + :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 :param description: The description of the Machine Learning compute. :type description: str :ivar created_on: The date and time when the compute was created. - :vartype created_on: datetime + :vartype created_on: ~datetime.datetime :ivar modified_on: The date and time when the compute was last modified. - :vartype modified_on: datetime - :param resource_id: ARM resource id of the underlying compute + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. :type resource_id: str - :ivar provisioning_errors: Errors during provisioning + :ivar provisioning_errors: Errors during provisioning. :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] - :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. + :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 - :param compute_type: Required. Constant filled by server. - :type compute_type: str :param properties: - :type properties: - ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsProperties + :type properties: ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsProperties """ _validation = { + 'compute_type': {'required': True}, 'provisioning_state': {'readonly': True}, 'created_on': {'readonly': True}, 'modified_on': {'readonly': True}, 'provisioning_errors': {'readonly': True}, 'is_attached_compute': {'readonly': True}, - 'compute_type': {'required': 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'}, @@ -914,20 +1414,27 @@ class DataLakeAnalytics(Compute): 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[MachineLearningServiceError]'}, 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsProperties'}, } - def __init__(self, *, compute_location: str=None, description: str=None, resource_id: str=None, properties=None, **kwargs) -> None: + def __init__( + self, + *, + compute_location: Optional[str] = None, + description: Optional[str] = None, + resource_id: Optional[str] = None, + properties: Optional["DataLakeAnalyticsProperties"] = None, + **kwargs + ): super(DataLakeAnalytics, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, **kwargs) + self.compute_type = 'DataLakeAnalytics' # type: str self.properties = properties - self.compute_type = 'DataLakeAnalytics' -class DataLakeAnalyticsProperties(Model): +class DataLakeAnalyticsProperties(msrest.serialization.Model): """DataLakeAnalyticsProperties. - :param data_lake_store_account_name: DataLake Store Account Name + :param data_lake_store_account_name: DataLake Store Account Name. :type data_lake_store_account_name: str """ @@ -935,12 +1442,51 @@ class DataLakeAnalyticsProperties(Model): 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, } - def __init__(self, *, data_lake_store_account_name: str=None, **kwargs) -> None: + def __init__( + self, + *, + data_lake_store_account_name: Optional[str] = None, + **kwargs + ): super(DataLakeAnalyticsProperties, self).__init__(**kwargs) self.data_lake_store_account_name = data_lake_store_account_name -class ErrorDetail(Model): +class EncryptionProperty(msrest.serialization.Model): + """EncryptionProperty. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. Indicates whether or not the encryption is enabled for the workspace. + Possible values include: "Enabled", "Disabled". + :type status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus + :param key_vault_properties: Required. Customer Key vault properties. + :type key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties + """ + + _validation = { + 'status': {'required': True}, + 'key_vault_properties': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, + } + + def __init__( + self, + *, + status: Union[str, "EncryptionStatus"], + key_vault_properties: "KeyVaultProperties", + **kwargs + ): + super(EncryptionProperty, self).__init__(**kwargs) + self.status = status + self.key_vault_properties = key_vault_properties + + +class ErrorDetail(msrest.serialization.Model): """Error detail information. All required parameters must be populated in order to send to Azure. @@ -961,25 +1507,29 @@ class ErrorDetail(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, *, code: str, message: str, **kwargs) -> None: + def __init__( + self, + *, + code: str, + message: str, + **kwargs + ): super(ErrorDetail, self).__init__(**kwargs) self.code = code self.message = message -class ErrorResponse(Model): +class ErrorResponse(msrest.serialization.Model): """Error response information. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar code: Error code. :vartype code: str :ivar message: Error message. :vartype message: str :ivar details: An array of error detail objects. - :vartype details: - list[~azure.mgmt.machinelearningservices.models.ErrorDetail] + :vartype details: list[~azure.mgmt.machinelearningservices.models.ErrorDetail] """ _validation = { @@ -994,61 +1544,146 @@ class ErrorResponse(Model): 'details': {'key': 'details', 'type': '[ErrorDetail]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(ErrorResponse, self).__init__(**kwargs) self.code = None self.message = None self.details = 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. + + :param retail_price: Required. The price charged for using the VM. + :type retail_price: float + :param os_type: Required. Operating system type used by the VM. Possible values include: + "Linux", "Windows". + :type os_type: str or ~azure.mgmt.machinelearningservices.models.VMPriceOSType + :param vm_tier: Required. The type of the VM. Possible values include: "Standard", + "LowPriority", "Spot". + :type 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 + ): + 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. + + :param billing_currency: Required. Three lettered code specifying the currency of the VM price. + Example: USD. Possible values include: "USD". + :type billing_currency: str or ~azure.mgmt.machinelearningservices.models.BillingCurrency + :param unit_of_measure: Required. The unit of time measurement for the specified VM price. + Example: OneHour. Possible values include: "OneHour". + :type unit_of_measure: str or ~azure.mgmt.machinelearningservices.models.UnitOfMeasure + :param values: Required. The list of estimated prices for using a VM of a particular OS type, + tier, etc. + :type 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 + ): + super(EstimatedVMPrices, self).__init__(**kwargs) + self.billing_currency = billing_currency + self.unit_of_measure = unit_of_measure + self.values = values + + class HDInsight(Compute): """A HDInsight compute. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param compute_location: Location for the underlying compute + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. :type 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' + :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 :param description: The description of the Machine Learning compute. :type description: str :ivar created_on: The date and time when the compute was created. - :vartype created_on: datetime + :vartype created_on: ~datetime.datetime :ivar modified_on: The date and time when the compute was last modified. - :vartype modified_on: datetime - :param resource_id: ARM resource id of the underlying compute + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. :type resource_id: str - :ivar provisioning_errors: Errors during provisioning + :ivar provisioning_errors: Errors during provisioning. :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] - :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. + :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 - :param compute_type: Required. Constant filled by server. - :type compute_type: str :param properties: - :type properties: - ~azure.mgmt.machinelearningservices.models.HDInsightProperties + :type properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties """ _validation = { + 'compute_type': {'required': True}, 'provisioning_state': {'readonly': True}, 'created_on': {'readonly': True}, 'modified_on': {'readonly': True}, 'provisioning_errors': {'readonly': True}, 'is_attached_compute': {'readonly': True}, - 'compute_type': {'required': 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'}, @@ -1057,26 +1692,31 @@ class HDInsight(Compute): 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[MachineLearningServiceError]'}, 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, } - def __init__(self, *, compute_location: str=None, description: str=None, resource_id: str=None, properties=None, **kwargs) -> None: + def __init__( + self, + *, + compute_location: Optional[str] = None, + description: Optional[str] = None, + resource_id: Optional[str] = None, + properties: Optional["HDInsightProperties"] = None, + **kwargs + ): super(HDInsight, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, **kwargs) + self.compute_type = 'HDInsight' # type: str self.properties = properties - self.compute_type = 'HDInsight' -class HDInsightProperties(Model): +class HDInsightProperties(msrest.serialization.Model): """HDInsightProperties. - :param ssh_port: Port open for ssh connections on the master node of the - cluster. + :param ssh_port: Port open for ssh connections on the master node of the cluster. :type ssh_port: int :param address: Public IP address of the master node of the cluster. :type address: str - :param administrator_account: Admin credentials for master node of the - cluster + :param administrator_account: Admin credentials for master node of the cluster. :type administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ @@ -1087,90 +1727,253 @@ class HDInsightProperties(Model): 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, } - def __init__(self, *, ssh_port: int=None, address: str=None, administrator_account=None, **kwargs) -> None: + def __init__( + self, + *, + ssh_port: Optional[int] = None, + address: Optional[str] = None, + administrator_account: Optional["VirtualMachineSshCredentials"] = None, + **kwargs + ): super(HDInsightProperties, self).__init__(**kwargs) self.ssh_port = ssh_port self.address = address self.administrator_account = administrator_account -class Identity(Model): +class Identity(msrest.serialization.Model): """Identity for the resource. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated 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 principal ID of resource identity. :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :param type: The identity type. Possible values include: 'SystemAssigned' - :type type: str or - ~azure.mgmt.machinelearningservices.models.ResourceIdentityType + :param type: Required. The identity type. Possible values include: "SystemAssigned", + "UserAssigned", "SystemAssigned,UserAssigned", "None". + :type type: str or ~azure.mgmt.machinelearningservices.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with resource. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.machinelearningservices.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] """ _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': 'ResourceIdentityType'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties}'}, } - def __init__(self, *, type=None, **kwargs) -> None: + def __init__( + self, + *, + type: Union[str, "ResourceIdentityType"], + user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + **kwargs + ): super(Identity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = type + self.user_assigned_identities = user_assigned_identities -class ListWorkspaceKeysResult(Model): - """ListWorkspaceKeysResult. +class KeyVaultProperties(msrest.serialization.Model): + """KeyVaultProperties. - Variables are only populated by the server, and will be ignored when - sending a request. + All required parameters must be populated in order to send to Azure. - :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 + :param key_vault_arm_id: Required. The ArmId of the keyVault where the customer owned + encryption key is present. + :type key_vault_arm_id: str + :param key_identifier: Required. Key vault uri to access the encryption key. + :type key_identifier: str + :param identity_client_id: For future use - The client id of the identity which will be used to + access key vault. + :type identity_client_id: str """ _validation = { - 'user_storage_key': {'readonly': True}, - 'user_storage_resource_id': {'readonly': True}, - 'app_insights_instrumentation_key': {'readonly': True}, - 'container_registry_credentials': {'readonly': True}, + 'key_vault_arm_id': {'required': True}, + 'key_identifier': {'required': 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'}, + '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 + ): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_vault_arm_id = key_vault_arm_id + self.key_identifier = key_identifier + self.identity_client_id = identity_client_id + + +class 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}, } - def __init__(self, **kwargs) -> None: - 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 + _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 MachineLearningServiceError(Model): + +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 + :param notebook_access_keys: + :type notebook_access_keys: + ~azure.mgmt.machinelearningservices.models.NotebookListCredentialsResult + """ + + _validation = { + 'user_storage_key': {'readonly': True}, + 'user_storage_resource_id': {'readonly': True}, + 'app_insights_instrumentation_key': {'readonly': True}, + 'container_registry_credentials': {'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': 'NotebookListCredentialsResult'}, + } + + def __init__( + self, + *, + notebook_access_keys: Optional["NotebookListCredentialsResult"] = None, + **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 = notebook_access_keys + + +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 MachineLearningServiceError(msrest.serialization.Model): """Wrapper for error response to follow ARM guidelines. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar error: The error response. :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorResponse @@ -1184,46 +1987,30 @@ class MachineLearningServiceError(Model): 'error': {'key': 'error', 'type': 'ErrorResponse'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(MachineLearningServiceError, self).__init__(**kwargs) self.error = None -class MachineLearningServiceErrorException(HttpOperationError): - """Server responsed with exception of type: 'MachineLearningServiceError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(MachineLearningServiceErrorException, self).__init__(deserialize, response, 'MachineLearningServiceError', *args) - - -class NodeStateCounts(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar idle_node_count: Idle node count. Number of compute nodes in idle - state. + :ivar idle_node_count: Number of compute nodes in idle state. :vartype idle_node_count: int - :ivar running_node_count: Running node count. Number of compute nodes - which are running jobs. + :ivar running_node_count: Number of compute nodes which are running jobs. :vartype running_node_count: int - :ivar preparing_node_count: Preparing node count. Number of compute nodes - which are being prepared. + :ivar preparing_node_count: Number of compute nodes which are being prepared. :vartype preparing_node_count: int - :ivar unusable_node_count: Unusable node count. Number of compute nodes - which are in unusable state. + :ivar unusable_node_count: Number of compute nodes which are in unusable state. :vartype unusable_node_count: int - :ivar leaving_node_count: Leaving node count. Number of compute nodes - which are leaving the amlCompute. + :ivar leaving_node_count: Number of compute nodes which are leaving the amlCompute. :vartype leaving_node_count: int - :ivar preempted_node_count: Preempted node count. Number of compute nodes - which are in preempted state. + :ivar preempted_node_count: Number of compute nodes which are in preempted state. :vartype preempted_node_count: int """ @@ -1245,7 +2032,10 @@ class NodeStateCounts(Model): 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(NodeStateCounts, self).__init__(**kwargs) self.idle_node_count = None self.running_node_count = None @@ -1255,12 +2045,96 @@ def __init__(self, **kwargs) -> None: self.preempted_node_count = None -class Operation(Model): +class NotebookListCredentialsResult(msrest.serialization.Model): + """NotebookListCredentialsResult. + + :param primary_access_key: + :type primary_access_key: str + :param secondary_access_key: + :type secondary_access_key: str + """ + + _attribute_map = { + 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, + 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, + } + + def __init__( + self, + *, + primary_access_key: Optional[str] = None, + secondary_access_key: Optional[str] = None, + **kwargs + ): + super(NotebookListCredentialsResult, self).__init__(**kwargs) + self.primary_access_key = primary_access_key + self.secondary_access_key = secondary_access_key + + +class NotebookPreparationError(msrest.serialization.Model): + """NotebookPreparationError. + + :param error_message: + :type error_message: str + :param status_code: + :type 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 + ): + super(NotebookPreparationError, self).__init__(**kwargs) + self.error_message = error_message + self.status_code = status_code + + +class NotebookResourceInfo(msrest.serialization.Model): + """NotebookResourceInfo. + + :param fqdn: + :type fqdn: str + :param resource_id: the data plane resourceId that used to initialize notebook component. + :type resource_id: str + :param notebook_preparation_error: The error that occurs when preparing notebook. + :type 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 + ): + super(NotebookResourceInfo, self).__init__(**kwargs) + self.fqdn = fqdn + self.resource_id = resource_id + self.notebook_preparation_error = notebook_preparation_error + + +class Operation(msrest.serialization.Model): """Azure Machine Learning workspace REST API operation. - :param name: Operation name: {provider}/{resource}/{operation} + :param name: Operation name: {provider}/{resource}/{operation}. :type name: str - :param display: Display name of operation + :param display: Display name of operation. :type display: ~azure.mgmt.machinelearningservices.models.OperationDisplay """ @@ -1269,17 +2143,22 @@ class Operation(Model): 'display': {'key': 'display', 'type': 'OperationDisplay'}, } - def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["OperationDisplay"] = None, + **kwargs + ): super(Operation, self).__init__(**kwargs) self.name = name self.display = display -class OperationDisplay(Model): +class OperationDisplay(msrest.serialization.Model): """Display name of operation. - :param provider: The resource provider name: - Microsoft.MachineLearningExperimentation + :param provider: The resource provider name: Microsoft.MachineLearningExperimentation. :type provider: str :param resource: The resource on which the operation is performed. :type resource: str @@ -1296,7 +2175,15 @@ class OperationDisplay(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): super(OperationDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -1304,11 +2191,84 @@ def __init__(self, *, provider: str=None, resource: str=None, operation: str=Non self.description = description -class Password(Model): +class OperationListResult(msrest.serialization.Model): + """An array of operations supported by the resource provider. + + :param value: List of AML workspace operations supported by the AML workspace resource + provider. + :type value: list[~azure.mgmt.machinelearningservices.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + *, + value: Optional[List["Operation"]] = None, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = value + + +class PaginatedComputeResourcesList(msrest.serialization.Model): + """Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. + + :param value: An array of Machine Learning compute objects wrapped in ARM resource envelope. + :type value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] + :param next_link: A continuation link (absolute URI) to the next page of results in the list. + :type 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 + ): + super(PaginatedComputeResourcesList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class PaginatedWorkspaceConnectionsList(msrest.serialization.Model): + """Paginated list of Workspace connection objects. + + :param value: An array of Workspace connection objects. + :type value: list[~azure.mgmt.machinelearningservices.models.WorkspaceConnection] + :param next_link: A continuation link (absolute URI) to the next page of results in the list. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkspaceConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["WorkspaceConnection"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(PaginatedWorkspaceConnectionsList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class Password(msrest.serialization.Model): """Password. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar name: :vartype name: str @@ -1326,17 +2286,277 @@ class Password(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(Password, self).__init__(**kwargs) self.name = None self.value = None -class RegistryListCredentialsResult(Model): +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(msrest.serialization.Model): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: ResourceId of the private endpoint connection. + :vartype id: str + :ivar name: Friendly name of the private endpoint connection. + :vartype name: str + :ivar type: Resource type of private endpoint connection. + :vartype type: str + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type 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}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + '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, + *, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = 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: Specifies the resource ID. + :vartype id: str + :ivar name: Specifies the name of the resource. + :vartype name: str + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.machinelearningservices.models.Identity + :param location: Specifies the location of the resource. + :type location: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :param tags: A set of tags. Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type 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] + :param required_zone_names: The private link resource Private link DNS zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', '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["Identity"] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + required_zone_names: Optional[List[str]] = None, + **kwargs + ): + super(PrivateLinkResource, self).__init__(identity=identity, location=location, tags=tags, sku=sku, **kwargs) + 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. + + :param value: Array of private link resources. + :type value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateLinkResource"]] = None, + **kwargs + ): + 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. + + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected", "Disconnected", + "Timeout". + :type status: str or + ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :type 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 + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + +class QuotaBaseProperties(msrest.serialization.Model): + """The properties for Quota update or retrieval. + + :param id: Specifies the resource ID. + :type id: str + :param type: Specifies the resource type. + :type type: str + :param limit: The maximum permitted quota of the resource. + :type limit: long + :param unit: An enum describing the unit of quota measurement. Possible values include: + "Count". + :type 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 + ): + 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. + + :param value: The list for update quota. + :type value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, + } + + def __init__( + self, + *, + value: Optional[List["QuotaBaseProperties"]] = None, + **kwargs + ): + super(QuotaUpdateParameters, self).__init__(**kwargs) + self.value = value + + +class RegistryListCredentialsResult(msrest.serialization.Model): """RegistryListCredentialsResult. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar location: :vartype location: str @@ -1357,20 +2577,24 @@ class RegistryListCredentialsResult(Model): 'passwords': {'key': 'passwords', 'type': '[Password]'}, } - def __init__(self, *, passwords=None, **kwargs) -> None: + def __init__( + self, + *, + passwords: Optional[List["Password"]] = None, + **kwargs + ): super(RegistryListCredentialsResult, self).__init__(**kwargs) self.location = None self.username = None self.passwords = passwords -class ResourceId(Model): - """Represents a resource ID. For example, for a subnet, it is the resource URL - for the subnet. +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. - :param id: Required. The ID of the resource + :param id: Required. The ID of the resource. :type id: str """ @@ -1382,23 +2606,206 @@ class ResourceId(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, *, id: str, **kwargs) -> None: + def __init__( + self, + *, + id: str, + **kwargs + ): super(ResourceId, self).__init__(**kwargs) self.id = id -class ScaleSettings(Model): +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 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}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'limit': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', '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.type = None + self.name = None + self.limit = None + self.unit = None + + +class ResourceSkuLocationInfo(msrest.serialization.Model): + """ResourceSkuLocationInfo. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: Location of the SKU. + :vartype location: str + :ivar zones: List of availability zones where the SKU is supported. + :vartype zones: list[str] + :ivar zone_details: Details of capabilities available to a SKU in specific zones. + :vartype zone_details: list[~azure.mgmt.machinelearningservices.models.ResourceSkuZoneDetails] + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'zone_details': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'zone_details': {'key': 'zoneDetails', 'type': '[ResourceSkuZoneDetails]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.zone_details = None + + +class ResourceSkuZoneDetails(msrest.serialization.Model): + """Describes The zonal capabilities of a SKU. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The set of zones that the SKU is available in with the specified capabilities. + :vartype name: list[str] + :ivar capabilities: A list of capabilities that are available for the SKU in the specified list + of zones. + :vartype capabilities: list[~azure.mgmt.machinelearningservices.models.SKUCapability] + """ + + _validation = { + 'name': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuZoneDetails, self).__init__(**kwargs) + self.name = None + self.capabilities = None + + +class Restriction(msrest.serialization.Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of restrictions. As of now only possible value for this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to location. This would + be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. Possible values include: "NotSpecified", + "NotAvailableForRegion", "NotAvailableForSubscription". + :type reason_code: str or ~azure.mgmt.machinelearningservices.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__( + self, + *, + reason_code: Optional[Union[str, "ReasonCode"]] = None, + **kwargs + ): + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = reason_code + + +class ScaleSettings(msrest.serialization.Model): """scale settings for AML Compute. All required parameters must be populated in order to send to Azure. - :param max_node_count: Required. Max number of nodes to use + :param max_node_count: Required. Max number of nodes to use. :type max_node_count: int - :param min_node_count: Min number of nodes to use. Default value: 0 . + :param min_node_count: Min number of nodes to use. :type min_node_count: int - :param node_idle_time_before_scale_down: Node Idle Time before scaling - down amlCompute - :type node_idle_time_before_scale_down: timedelta + :param node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. + :type node_idle_time_before_scale_down: ~datetime.timedelta """ _validation = { @@ -1411,21 +2818,28 @@ class ScaleSettings(Model): 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, } - def __init__(self, *, max_node_count: int, min_node_count: int=0, node_idle_time_before_scale_down=None, **kwargs) -> None: + def __init__( + self, + *, + max_node_count: int, + min_node_count: Optional[int] = 0, + node_idle_time_before_scale_down: Optional[datetime.timedelta] = None, + **kwargs + ): 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 ServicePrincipalCredentials(Model): +class ServicePrincipalCredentials(msrest.serialization.Model): """Service principal credentials. All required parameters must be populated in order to send to Azure. - :param client_id: Required. Client Id + :param client_id: Required. Client Id. :type client_id: str - :param client_secret: Required. Client secret + :param client_secret: Required. Client secret. :type client_secret: str """ @@ -1439,23 +2853,212 @@ class ServicePrincipalCredentials(Model): 'client_secret': {'key': 'clientSecret', 'type': 'str'}, } - def __init__(self, *, client_id: str, client_secret: str, **kwargs) -> None: + def __init__( + self, + *, + client_id: str, + client_secret: str, + **kwargs + ): super(ServicePrincipalCredentials, self).__init__(**kwargs) self.client_id = client_id self.client_secret = client_secret -class SslConfiguration(Model): +class SharedPrivateLinkResource(msrest.serialization.Model): + """SharedPrivateLinkResource. + + :param name: Unique name of the private link. + :type name: str + :param private_link_resource_id: The resource id that private link links to. + :type private_link_resource_id: str + :param group_id: The private link resource group id. + :type group_id: str + :param request_message: Request message. + :type request_message: str + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected", "Disconnected", + "Timeout". + :type 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 + ): + super(SharedPrivateLinkResource, self).__init__(**kwargs) + self.name = name + self.private_link_resource_id = private_link_resource_id + self.group_id = group_id + self.request_message = request_message + self.status = status + + +class Sku(msrest.serialization.Model): + """Sku of the resource. + + :param name: Name of the sku. + :type name: str + :param tier: Tier of the sku like Basic or Enterprise. + :type tier: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + tier: Optional[str] = None, + **kwargs + ): + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + + +class SKUCapability(msrest.serialization.Model): + """Features/user capabilities associated with the sku. + + :param name: Capability/Feature ID. + :type name: str + :param value: Details about the feature/capability. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(SKUCapability, self).__init__(**kwargs) + self.name = name + self.value = value + + +class SkuListResult(msrest.serialization.Model): + """List of skus with features. + + :param value: + :type value: list[~azure.mgmt.machinelearningservices.models.WorkspaceSku] + :param next_link: The URI to fetch the next page of Workspace Skus. Call ListNext() with this + URI to fetch the next page of Workspace Skus. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkspaceSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["WorkspaceSku"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(SkuListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SkuSettings(msrest.serialization.Model): + """Describes Workspace Sku details and features. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar locations: The set of locations that the SKU is available. This will be supported and + registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). + :vartype locations: list[str] + :ivar location_info: A list of locations and availability zones in those locations where the + SKU is available. + :vartype location_info: + list[~azure.mgmt.machinelearningservices.models.ResourceSkuLocationInfo] + :ivar tier: Sku Tier like Basic or Enterprise. + :vartype tier: str + :ivar resource_type: + :vartype resource_type: str + :ivar name: + :vartype name: str + :ivar capabilities: List of features/user capabilities associated with the sku. + :vartype capabilities: list[~azure.mgmt.machinelearningservices.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. This is empty if + there are no restrictions. + :type restrictions: list[~azure.mgmt.machinelearningservices.models.Restriction] + """ + + _validation = { + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[ResourceSkuLocationInfo]'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__( + self, + *, + restrictions: Optional[List["Restriction"]] = None, + **kwargs + ): + super(SkuSettings, self).__init__(**kwargs) + self.locations = None + self.location_info = None + self.tier = None + self.resource_type = None + self.name = None + self.capabilities = None + self.restrictions = restrictions + + +class SslConfiguration(msrest.serialization.Model): """The ssl configuration for scoring. - :param status: Enable or disable ssl for scoring. Possible values include: - 'Disabled', 'Enabled' - :type status: str or ~azure.mgmt.machinelearningservices.models.enum - :param cert: Cert data + :param status: Enable or disable ssl for scoring. Possible values include: "Disabled", + "Enabled". + :type status: str or ~azure.mgmt.machinelearningservices.models.SslConfigurationStatus + :param cert: Cert data. :type cert: str - :param key: Key data + :param key: Key data. :type key: str - :param cname: CNAME of the cert + :param cname: CNAME of the cert. :type cname: str """ @@ -1466,7 +3069,15 @@ class SslConfiguration(Model): 'cname': {'key': 'cname', 'type': 'str'}, } - def __init__(self, *, status=None, cert: str=None, key: str=None, cname: str=None, **kwargs) -> None: + def __init__( + self, + *, + status: Optional[Union[str, "SslConfigurationStatus"]] = None, + cert: Optional[str] = None, + key: Optional[str] = None, + cname: Optional[str] = None, + **kwargs + ): super(SslConfiguration, self).__init__(**kwargs) self.status = status self.cert = cert @@ -1474,15 +3085,14 @@ def __init__(self, *, status=None, cert: str=None, key: str=None, cname: str=Non self.cname = cname -class SystemService(Model): +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. + 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 + :ivar public_ip_address: Public IP address. :vartype public_ip_address: str :ivar version: The version for this type. :vartype version: str @@ -1500,25 +3110,106 @@ class SystemService(Model): 'version': {'key': 'version', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(SystemService, self).__init__(**kwargs) self.system_service_type = None self.public_ip_address = None self.version = None -class Usage(Model): +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 + :param limit: The maximum permitted quota of the resource. + :type 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 + :param status: Status of update workspace quota. Possible values include: "Undefined", + "Success", "Failure", "InvalidQuotaBelowClusterMinimum", + "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", + "OperationNotEnabledForRegion". + :type 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 + ): + super(UpdateWorkspaceQuotas, self).__init__(**kwargs) + self.id = None + self.type = None + self.limit = limit + self.unit = None + self.status = status + + +class UpdateWorkspaceQuotasResult(msrest.serialization.Model): + """The result of update workspace quota. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of workspace quota update result. + :vartype value: list[~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotas] + :ivar next_link: The URI to fetch the next page of workspace quota update result. Call + ListNext() with this to fetch the next page of Workspace Quota update result. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Usage(msrest.serialization.Model): """Describes AML Resource Usage. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 unit: An enum describing the unit of usage measurement. Possible - values include: 'Count' + :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 @@ -1546,7 +3237,10 @@ class Usage(Model): 'name': {'key': 'name', 'type': 'UsageName'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(Usage, self).__init__(**kwargs) self.id = None self.type = None @@ -1556,11 +3250,10 @@ def __init__(self, **kwargs) -> None: self.name = None -class UsageName(Model): +class UsageName(msrest.serialization.Model): """The Usage Names. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -1578,26 +3271,26 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None -class UserAccountCredentials(Model): - """Settings for user account that gets created on each on the nodes of a - compute. +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. - :param admin_user_name: Required. User name. Name of the administrator - user account which can be used to SSH to nodes. + :param admin_user_name: Required. Name of the administrator user account which can be used to + SSH to nodes. :type admin_user_name: str - :param admin_user_ssh_public_key: SSH public key. SSH public key of the - administrator user account. + :param admin_user_ssh_public_key: SSH public key of the administrator user account. :type admin_user_ssh_public_key: str - :param admin_user_password: Password. Password of the administrator user - account. + :param admin_user_password: Password of the administrator user account. :type admin_user_password: str """ @@ -1611,7 +3304,14 @@ class UserAccountCredentials(Model): 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, } - def __init__(self, *, admin_user_name: str, admin_user_ssh_public_key: str=None, admin_user_password: str=None, **kwargs) -> None: + def __init__( + self, + *, + admin_user_name: str, + admin_user_ssh_public_key: Optional[str] = None, + admin_user_password: Optional[str] = None, + **kwargs + ): super(UserAccountCredentials, self).__init__(**kwargs) self.admin_user_name = admin_user_name self.admin_user_ssh_public_key = admin_user_ssh_public_key @@ -1621,51 +3321,50 @@ def __init__(self, *, admin_user_name: str, admin_user_ssh_public_key: str=None, class VirtualMachine(Compute): """A Machine Learning compute based on Azure Virtual Machines. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param compute_location: Location for the underlying compute + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. :type 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' + :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 :param description: The description of the Machine Learning compute. :type description: str :ivar created_on: The date and time when the compute was created. - :vartype created_on: datetime + :vartype created_on: ~datetime.datetime :ivar modified_on: The date and time when the compute was last modified. - :vartype modified_on: datetime - :param resource_id: ARM resource id of the underlying compute + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. :type resource_id: str - :ivar provisioning_errors: Errors during provisioning + :ivar provisioning_errors: Errors during provisioning. :vartype provisioning_errors: list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] - :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. + :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 - :param compute_type: Required. Constant filled by server. - :type compute_type: str :param properties: - :type properties: - ~azure.mgmt.machinelearningservices.models.VirtualMachineProperties + :type properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineProperties """ _validation = { + 'compute_type': {'required': True}, 'provisioning_state': {'readonly': True}, 'created_on': {'readonly': True}, 'modified_on': {'readonly': True}, 'provisioning_errors': {'readonly': True}, 'is_attached_compute': {'readonly': True}, - 'compute_type': {'required': 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'}, @@ -1674,26 +3373,33 @@ class VirtualMachine(Compute): 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[MachineLearningServiceError]'}, 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'VirtualMachineProperties'}, } - def __init__(self, *, compute_location: str=None, description: str=None, resource_id: str=None, properties=None, **kwargs) -> None: + def __init__( + self, + *, + compute_location: Optional[str] = None, + description: Optional[str] = None, + resource_id: Optional[str] = None, + properties: Optional["VirtualMachineProperties"] = None, + **kwargs + ): super(VirtualMachine, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, **kwargs) + self.compute_type = 'VirtualMachine' # type: str self.properties = properties - self.compute_type = 'VirtualMachine' -class VirtualMachineProperties(Model): +class VirtualMachineProperties(msrest.serialization.Model): """VirtualMachineProperties. - :param virtual_machine_size: Virtual Machine size + :param virtual_machine_size: Virtual Machine size. :type virtual_machine_size: str :param ssh_port: Port open for ssh connections. :type ssh_port: int :param address: Public IP address of the virtual machine. :type address: str - :param administrator_account: Admin credentials for virtual machine + :param administrator_account: Admin credentials for virtual machine. :type administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ @@ -1705,7 +3411,15 @@ class VirtualMachineProperties(Model): 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, } - def __init__(self, *, virtual_machine_size: str=None, ssh_port: int=None, address: str=None, administrator_account=None, **kwargs) -> None: + def __init__( + self, + *, + virtual_machine_size: Optional[str] = None, + ssh_port: Optional[int] = None, + address: Optional[str] = None, + administrator_account: Optional["VirtualMachineSshCredentials"] = None, + **kwargs + ): super(VirtualMachineProperties, self).__init__(**kwargs) self.virtual_machine_size = virtual_machine_size self.ssh_port = ssh_port @@ -1718,8 +3432,10 @@ class VirtualMachineSecrets(ComputeSecrets): All required parameters must be populated in order to send to Azure. - :param compute_type: Required. Constant filled by server. - :type compute_type: str + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "ComputeInstance", "DataFactory", "VirtualMachine", "HDInsight", + "Databricks", "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType :param administrator_account: Admin credentials for virtual machine. :type administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials @@ -1734,48 +3450,53 @@ class VirtualMachineSecrets(ComputeSecrets): 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, } - def __init__(self, *, administrator_account=None, **kwargs) -> None: + def __init__( + self, + *, + administrator_account: Optional["VirtualMachineSshCredentials"] = None, + **kwargs + ): super(VirtualMachineSecrets, self).__init__(**kwargs) + self.compute_type = 'VirtualMachine' # type: str self.administrator_account = administrator_account - self.compute_type = 'VirtualMachine' -class VirtualMachineSize(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Virtual Machine size name. The name of the virtual machine - size. + :ivar name: The name of the virtual machine size. :vartype name: str - :ivar family: Virtual Machine family name. The family name of the virtual - machine size. + :ivar family: The family name of the virtual machine size. :vartype family: str - :ivar v_cp_us: Number of vPUs. The number of vCPUs supported by the - virtual machine size. + :ivar v_cp_us: The number of vCPUs supported by the virtual machine size. :vartype v_cp_us: int - :ivar os_vhd_size_mb: OS VHD Disk size. The OS VHD disk size, in MB, - allowed by the virtual machine size. + :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: Resource volume size. The resource volume - size, in MB, allowed by the virtual machine size. + :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: Memory size. The amount of memory, in GB, supported by - the virtual machine size. + :ivar memory_gb: The amount of memory, in GB, supported by the virtual machine size. :vartype memory_gb: float - :ivar low_priority_capable: Low priority capable. Specifies if the virtual - machine size supports low priority VMs. + :ivar low_priority_capable: Specifies if the virtual machine size supports low priority VMs. :vartype low_priority_capable: bool - :ivar premium_io: Premium IO supported. Specifies if the virtual machine - size supports premium IO. + :ivar premium_io: Specifies if the virtual machine size supports premium IO. :vartype premium_io: bool + :param estimated_vm_prices: The estimated price information for using a VM. + :type estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices + :param supported_compute_types: Specifies the compute types supported by the virtual machine + size. + :type 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}, @@ -1787,53 +3508,68 @@ class VirtualMachineSize(Model): '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) -> None: + def __init__( + self, + *, + estimated_vm_prices: Optional["EstimatedVMPrices"] = None, + supported_compute_types: Optional[List[str]] = None, + **kwargs + ): 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(Model): +class VirtualMachineSizeListResult(msrest.serialization.Model): """The List Virtual Machine size operation response. - :param aml_compute: The list of virtual machine sizes supported by - AmlCompute. - :type aml_compute: - list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] + :param aml_compute: The list of virtual machine sizes supported by AmlCompute. + :type aml_compute: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] """ _attribute_map = { 'aml_compute': {'key': 'amlCompute', 'type': '[VirtualMachineSize]'}, } - def __init__(self, *, aml_compute=None, **kwargs) -> None: + def __init__( + self, + *, + aml_compute: Optional[List["VirtualMachineSize"]] = None, + **kwargs + ): super(VirtualMachineSizeListResult, self).__init__(**kwargs) self.aml_compute = aml_compute -class VirtualMachineSshCredentials(Model): +class VirtualMachineSshCredentials(msrest.serialization.Model): """Admin credentials for virtual machine. - :param username: Username of admin account + :param username: Username of admin account. :type username: str - :param password: Password of admin account + :param password: Password of admin account. :type password: str - :param public_key_data: Public key data + :param public_key_data: Public key data. :type public_key_data: str - :param private_key_data: Private key data + :param private_key_data: Private key data. :type private_key_data: str """ @@ -1844,7 +3580,15 @@ class VirtualMachineSshCredentials(Model): 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, } - def __init__(self, *, username: str=None, password: str=None, public_key_data: str=None, private_key_data: str=None, **kwargs) -> None: + def __init__( + self, + *, + username: Optional[str] = None, + password: Optional[str] = None, + public_key_data: Optional[str] = None, + private_key_data: Optional[str] = None, + **kwargs + ): super(VirtualMachineSshCredentials, self).__init__(**kwargs) self.username = username self.password = password @@ -1855,64 +3599,87 @@ def __init__(self, *, username: str=None, password: str=None, public_key_data: s 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. + 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 name: Specifies the name of the resource. :vartype name: str - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.machinelearningservices.models.Identity + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.machinelearningservices.models.Identity :param location: Specifies the location of the resource. :type location: str :ivar type: Specifies the type of the resource. :vartype type: str - :param tags: Contains resource tags defined as key/value pairs. + :param tags: A set of tags. Contains resource tags defined as key/value pairs. :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku :ivar workspace_id: The immutable id associated with this workspace. :vartype workspace_id: str :param description: The description of this workspace. :type description: str - :param friendly_name: The friendly name for this workspace. This name in - mutable + :param friendly_name: The friendly name for this workspace. This name in mutable. :type friendly_name: str - :ivar creation_time: The creation time of the machine learning workspace - in ISO8601 format. - :vartype creation_time: datetime - :param key_vault: ARM id of the key vault associated with this workspace. - This cannot be changed once the workspace has been created + :ivar creation_time: The creation time of the machine learning workspace in ISO8601 format. + :vartype creation_time: ~datetime.datetime + :param key_vault: ARM id of the key vault associated with this workspace. This cannot be + changed once the workspace has been created. :type key_vault: str - :param application_insights: ARM id of the application insights associated - with this workspace. This cannot be changed once the workspace has been - created + :param application_insights: ARM id of the application insights associated with this workspace. + This cannot be changed once the workspace has been created. :type application_insights: str - :param container_registry: ARM id of the container registry associated - with this workspace. This cannot be changed once the workspace has been - created + :param container_registry: ARM id of the container registry associated with this workspace. + This cannot be changed once the workspace has been created. :type container_registry: str - :param storage_account: ARM id of the storage account associated with this - workspace. This cannot be changed once the workspace has been created + :param storage_account: ARM id of the storage account associated with this workspace. This + cannot be changed once the workspace has been created. :type storage_account: str - :param discovery_url: Url for the discovery service to identify regional - endpoints for machine learning experimentation services + :param discovery_url: Url for the discovery service to identify regional endpoints for machine + learning experimentation services. :type 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' + :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 + :param encryption: The encryption settings of Azure ML workspace. + :type encryption: ~azure.mgmt.machinelearningservices.models.EncryptionProperty + :param hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data + collected by the service. + :type 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 + :param image_build_compute: The compute name for image build. + :type image_build_compute: str + :param allow_public_access_when_behind_vnet: The flag to indicate whether to allow public + access when behind VNet. + :type allow_public_access_when_behind_vnet: bool + :ivar private_endpoint_connections: The list of private endpoint connections in the workspace. + :vartype private_endpoint_connections: + list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] + :param shared_private_link_resources: The list of shared private link resources in this + workspace. + :type 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 """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, - 'identity': {'readonly': True}, 'type': {'readonly': True}, 'workspace_id': {'readonly': True}, 'creation_time': {'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}, } _attribute_map = { @@ -1922,6 +3689,7 @@ class Workspace(Resource): 'location': {'key': 'location', 'type': 'str'}, 'type': {'key': 'type', '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'}, @@ -1932,10 +3700,39 @@ class Workspace(Resource): 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__(self, *, location: str=None, tags=None, description: str=None, friendly_name: str=None, key_vault: str=None, application_insights: str=None, container_registry: str=None, storage_account: str=None, discovery_url: str=None, **kwargs) -> None: - super(Workspace, self).__init__(location=location, tags=tags, **kwargs) + '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'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, + 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, + } + + def __init__( + self, + *, + identity: Optional["Identity"] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + description: Optional[str] = None, + friendly_name: Optional[str] = None, + key_vault: Optional[str] = None, + application_insights: Optional[str] = None, + container_registry: Optional[str] = None, + storage_account: Optional[str] = None, + discovery_url: Optional[str] = None, + encryption: Optional["EncryptionProperty"] = None, + hbi_workspace: Optional[bool] = False, + image_build_compute: Optional[str] = None, + allow_public_access_when_behind_vnet: Optional[bool] = False, + shared_private_link_resources: Optional[List["SharedPrivateLinkResource"]] = None, + **kwargs + ): + super(Workspace, self).__init__(identity=identity, location=location, tags=tags, sku=sku, **kwargs) self.workspace_id = None self.description = description self.friendly_name = friendly_name @@ -1946,13 +3743,179 @@ def __init__(self, *, location: str=None, tags=None, description: str=None, frie 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.private_endpoint_connections = None + self.shared_private_link_resources = shared_private_link_resources + self.notebook_info = None + + +class WorkspaceConnection(msrest.serialization.Model): + """Workspace connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: ResourceId of the workspace connection. + :vartype id: str + :ivar name: Friendly name of the workspace connection. + :vartype name: str + :ivar type: Resource type of workspace connection. + :vartype type: str + :param category: Category of the workspace connection. + :type category: str + :param target: Target of the workspace connection. + :type target: str + :param auth_type: Authorization type of the workspace connection. + :type auth_type: str + :param value: Value details of the workspace connection. + :type value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'target': {'key': 'properties.target', 'type': 'str'}, + 'auth_type': {'key': 'properties.authType', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + } + + def __init__( + self, + *, + category: Optional[str] = None, + target: Optional[str] = None, + auth_type: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(WorkspaceConnection, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.category = category + self.target = target + self.auth_type = auth_type + self.value = value + + +class WorkspaceConnectionDto(msrest.serialization.Model): + """object used for creating workspace connection. + + :param name: Friendly name of the workspace connection. + :type name: str + :param category: Category of the workspace connection. + :type category: str + :param target: Target of the workspace connection. + :type target: str + :param auth_type: Authorization type of the workspace connection. + :type auth_type: str + :param value: Value details of the workspace connection. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'target': {'key': 'properties.target', 'type': 'str'}, + 'auth_type': {'key': 'properties.authType', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + category: Optional[str] = None, + target: Optional[str] = None, + auth_type: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(WorkspaceConnectionDto, self).__init__(**kwargs) + self.name = name + self.category = category + self.target = target + self.auth_type = auth_type + self.value = value + + +class WorkspaceListResult(msrest.serialization.Model): + """The result of a request to list machine learning workspaces. + + :param 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. + :type value: list[~azure.mgmt.machinelearningservices.models.Workspace] + :param next_link: The URI that can be used to request the next list of machine learning + workspaces. + :type 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 + ): + super(WorkspaceListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class WorkspaceSku(msrest.serialization.Model): + """AML workspace sku information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: + :vartype resource_type: str + :ivar skus: The list of workspace sku settings. + :vartype skus: list[~azure.mgmt.machinelearningservices.models.SkuSettings] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'skus': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'skus': {'key': 'skus', 'type': '[SkuSettings]'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkspaceSku, self).__init__(**kwargs) + self.resource_type = None + self.skus = None -class WorkspaceUpdateParameters(Model): +class WorkspaceUpdateParameters(msrest.serialization.Model): """The parameters for updating a machine learning workspace. - :param tags: The resource tags for the machine learning workspace. + :param tags: A set of tags. The resource tags for the machine learning workspace. :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku :param description: The description of this workspace. :type description: str :param friendly_name: The friendly name for this workspace. @@ -1961,12 +3924,22 @@ class WorkspaceUpdateParameters(Model): _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, } - def __init__(self, *, tags=None, description: str=None, friendly_name: str=None, **kwargs) -> None: + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + description: Optional[str] = None, + friendly_name: Optional[str] = None, + **kwargs + ): super(WorkspaceUpdateParameters, self).__init__(**kwargs) self.tags = tags + self.sku = sku self.description = description self.friendly_name = friendly_name diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_paged_models.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_paged_models.py deleted file mode 100644 index 9bc3567bbf90..000000000000 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_paged_models.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 msrest.paging import Paged - - -class OperationPaged(Paged): - """ - A paging container for iterating over a list of :class:`Operation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Operation]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationPaged, self).__init__(*args, **kwargs) -class WorkspacePaged(Paged): - """ - A paging container for iterating over a list of :class:`Workspace ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Workspace]'} - } - - def __init__(self, *args, **kwargs): - - super(WorkspacePaged, self).__init__(*args, **kwargs) -class UsagePaged(Paged): - """ - A paging container for iterating over a list of :class:`Usage ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Usage]'} - } - - def __init__(self, *args, **kwargs): - - super(UsagePaged, self).__init__(*args, **kwargs) -class ComputeResourcePaged(Paged): - """ - A paging container for iterating over a list of :class:`ComputeResource ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ComputeResource]'} - } - - def __init__(self, *args, **kwargs): - - super(ComputeResourcePaged, self).__init__(*args, **kwargs) diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/__init__.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/__init__.py index 4daae17a67dd..516999b100d8 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/__init__.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/__init__.py @@ -1,24 +1,35 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from ._operations import Operations from ._workspaces_operations import WorkspacesOperations +from ._workspace_features_operations import WorkspaceFeaturesOperations +from ._notebooks_operations import NotebooksOperations from ._usages_operations import UsagesOperations from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations +from ._quotas_operations import QuotasOperations +from ._workspace_connections_operations import WorkspaceConnectionsOperations from ._machine_learning_compute_operations import MachineLearningComputeOperations +from ._azure_machine_learning_workspaces_operations import AzureMachineLearningWorkspacesOperationsMixin +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations __all__ = [ 'Operations', 'WorkspacesOperations', + 'WorkspaceFeaturesOperations', + 'NotebooksOperations', 'UsagesOperations', 'VirtualMachineSizesOperations', + 'QuotasOperations', + 'WorkspaceConnectionsOperations', 'MachineLearningComputeOperations', + 'AzureMachineLearningWorkspacesOperationsMixin', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', ] diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_azure_machine_learning_workspaces_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_azure_machine_learning_workspaces_operations.py new file mode 100644 index 000000000000..618fb681d293 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_azure_machine_learning_workspaces_operations.py @@ -0,0 +1,94 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AzureMachineLearningWorkspacesOperationsMixin(object): + + def list_skus( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.SkuListResult"] + """Lists all skus with associated features. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SkuListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SkuListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces/skus'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_machine_learning_compute_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_machine_learning_compute_operations.py index 203b86e19b28..8ad4c9b596be 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_machine_learning_compute_operations.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_machine_learning_compute_operations.py @@ -1,643 +1,896 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class MachineLearningComputeOperations(object): """MachineLearningComputeOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.machinelearningservices.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2019-05-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01" - - self.config = config + self._config = config def list_by_workspace( - self, resource_group_name, workspace_name, skiptoken=None, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + workspace_name, # type: str + skiptoken=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.PaginatedComputeResourcesList"] """Gets computes in specified workspace. - :param resource_group_name: Name of the resource group in which - workspace is located. + :param resource_group_name: Name of the resource group in which workspace is located. :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str :param skiptoken: Continuation token for pagination. :type skiptoken: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ComputeResource - :rtype: - ~azure.mgmt.machinelearningservices.models.ComputeResourcePaged[~azure.mgmt.machinelearningservices.models.ComputeResource] - :raises: - :class:`MachineLearningServiceErrorException` + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PaginatedComputeResourcesList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PaginatedComputeResourcesList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL - url = self.list_by_workspace.metadata['url'] + url = self.list_by_workspace.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str') + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') if skiptoken is not None: query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - raise models.MachineLearningServiceErrorException(self._deserialize, response) - - return response + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ComputeResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes'} + return ItemPaged( + get_next, extract_data + ) + list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes'} # type: ignore def get( - self, resource_group_name, workspace_name, compute_name, custom_headers=None, raw=False, **operation_config): - """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: Name of the resource group in which - workspace is located. + 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: Name of the resource group in which workspace is located. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ComputeResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`MachineLearningServiceErrorException` + :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 = "2020-08-01" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), - 'computeName': self._serialize.url("compute_name", compute_name, 'str') + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - raise models.MachineLearningServiceErrorException(self._deserialize, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', response) + deserialized = self._deserialize('ComputeResource', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} - + 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, workspace_name, compute_name, parameters, custom_headers=None, raw=False, **operation_config): + 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 = "2020-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.create_or_update.metadata['url'] + url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), - 'computeName': self._serialize.url("compute_name", compute_name, 'str') + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ComputeResource') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ComputeResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200, 201]: - raise models.MachineLearningServiceErrorException(self._deserialize, response) - - deserialized = None - header_dict = {} + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', response) - header_dict = { - 'Azure-AsyncOperation': 'str', - } + deserialized = self._deserialize('ComputeResource', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('ComputeResource', response) - header_dict = { - 'Azure-AsyncOperation': 'str', - } + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + deserialized = self._deserialize('ComputeResource', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, response_headers) return deserialized - - def create_or_update( - self, resource_group_name, workspace_name, compute_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """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: Name of the resource group in which - workspace is located. + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + + 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: Name of the resource group in which workspace is located. :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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ComputeResource or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.machinelearningservices.models.ComputeResource]] - :raises: - :class:`MachineLearningServiceErrorException` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + 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 ) - - def get_long_running_output(response): - header_dict = { - 'Azure-AsyncOperation': 'str', - } - deserialized = self._deserialize('ComputeResource', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + deserialized = self._deserialize('ComputeResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} - + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore def _update_initial( - self, resource_group_name, workspace_name, compute_name, scale_settings=None, custom_headers=None, raw=False, **operation_config): - parameters = models.ClusterUpdateParameters(scale_settings=scale_settings) + self, + resource_group_name, # type: str + workspace_name, # type: str + compute_name, # type: str + scale_settings=None, # type: Optional["models.ScaleSettings"] + **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', {})) + + _parameters = models.ClusterUpdateParameters(scale_settings=scale_settings) + api_version = "2020-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL - url = self.update.metadata['url'] + url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), - 'computeName': self._serialize.url("compute_name", compute_name, 'str') + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ClusterUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if response.status_code not in [200]: - raise models.MachineLearningServiceErrorException(self._deserialize, response) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ClusterUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response - deserialized = None + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', response) + deserialized = self._deserialize('ComputeResource', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def update( - self, resource_group_name, workspace_name, compute_name, scale_settings=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Updates properties of a compute. This call will overwrite a compute if - it exists. This is a nonrecoverable operation. - - :param resource_group_name: Name of the resource group in which - workspace is located. + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + workspace_name, # type: str + compute_name, # type: str + scale_settings=None, # type: Optional["models.ScaleSettings"] + **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: Name of the resource group in which workspace is located. :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 scale_settings: Scale settings. Desired scale settings for the - amlCompute. - :type scale_settings: - ~azure.mgmt.machinelearningservices.models.ScaleSettings - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param scale_settings: Desired scale settings for the amlCompute. + :type scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ComputeResource or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.machinelearningservices.models.ComputeResource]] - :raises: - :class:`MachineLearningServiceErrorException` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - compute_name=compute_name, - scale_settings=scale_settings, - custom_headers=custom_headers, - raw=True, - **operation_config + 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 ) - - def get_long_running_output(response): - deserialized = self._deserialize('ComputeResource', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + scale_settings=scale_settings, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ComputeResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} - + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore def _delete_initial( - self, resource_group_name, workspace_name, compute_name, underlying_resource_action, custom_headers=None, raw=False, **operation_config): + 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 = "2020-08-01" + accept = "application/json" + # Construct URL - url = self.delete.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), - 'computeName': self._serialize.url("compute_name", compute_name, 'str') + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') query_parameters['underlyingResourceAction'] = self._serialize.query("underlying_resource_action", underlying_resource_action, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200, 202]: - raise models.MachineLearningServiceErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - header_dict = { - 'Azure-AsyncOperation': 'str', - 'Location': 'str', - } - client_raw_response.add_headers(header_dict) - return client_raw_response - - def delete( - self, resource_group_name, workspace_name, compute_name, underlying_resource_action, custom_headers=None, raw=False, polling=True, **operation_config): + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + 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 + + def begin_delete( + self, + resource_group_name, # type: str + workspace_name, # type: str + compute_name, # type: str + underlying_resource_action, # type: Union[str, "models.UnderlyingResourceAction"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes specified Machine Learning compute. - :param resource_group_name: Name of the resource group in which - workspace is located. + :param resource_group_name: Name of the resource group in which workspace is located. :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'. - Possible values include: 'Delete', 'Detach' - :type underlying_resource_action: str or - ~azure.mgmt.machinelearningservices.models.UnderlyingResourceAction - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`MachineLearningServiceErrorException` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - 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, - custom_headers=custom_headers, - raw=True, - **operation_config + 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 ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - client_raw_response.add_headers({ - 'Azure-AsyncOperation': 'str', - 'Location': 'str', - }) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + compute_name=compute_name, + underlying_resource_action=underlying_resource_action, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore def list_nodes( - self, resource_group_name, workspace_name, compute_name, custom_headers=None, raw=False, **operation_config): - """Get the details (e.g IP address, port etc) of all the compute nodes in - the compute. - - :param resource_group_name: Name of the resource group in which - workspace is located. + self, + resource_group_name, # type: str + workspace_name, # type: str + compute_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AmlComputeNodesInformation" + """Get the details (e.g IP address, port etc) of all the compute nodes in the compute. + + :param resource_group_name: Name of the resource group in which workspace is located. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AmlComputeNodesInformation or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`MachineLearningServiceErrorException` + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AmlComputeNodesInformation, or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AmlComputeNodesInformation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + # Construct URL - url = self.list_nodes.metadata['url'] + url = self.list_nodes.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), - 'computeName': self._serialize.url("compute_name", compute_name, 'str') + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - raise models.MachineLearningServiceErrorException(self._deserialize, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('AmlComputeNodesInformation', response) + deserialized = self._deserialize('AmlComputeNodesInformation', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - list_nodes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes'} + list_nodes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes'} # type: ignore def list_keys( - self, resource_group_name, workspace_name, compute_name, custom_headers=None, raw=False, **operation_config): - """Gets secrets related to Machine Learning compute (storage keys, service - credentials, etc). - - :param resource_group_name: Name of the resource group in which - workspace is located. + 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: Name of the resource group in which workspace is located. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ComputeSecrets or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`MachineLearningServiceErrorException` + :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 = "2020-08-01" + accept = "application/json" + # Construct URL - url = self.list_keys.metadata['url'] + url = self.list_keys.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), - 'computeName': self._serialize.url("compute_name", compute_name, 'str') + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - raise models.MachineLearningServiceErrorException(self._deserialize, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ComputeSecrets', response) + deserialized = self._deserialize('ComputeSecrets', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys'} # type: ignore + + def start( + self, + resource_group_name, # type: str + workspace_name, # type: str + compute_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Posts a start action to a compute instance. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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: 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 = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self.start.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} # type: ignore + + def stop( + self, + resource_group_name, # type: str + workspace_name, # type: str + compute_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Posts a stop action to a compute instance. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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: 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 = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self.stop.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} # type: ignore + + def restart( + self, + resource_group_name, # type: str + workspace_name, # type: str + compute_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Posts a restart action to a compute instance. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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: 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 = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self.restart.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_notebooks_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_notebooks_operations.py new file mode 100644 index 000000000000..6071d8255e81 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_notebooks_operations.py @@ -0,0 +1,160 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class NotebooksOperations(object): + """NotebooksOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.machinelearningservices.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An 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 _prepare_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 = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self._prepare_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, 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_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore + + def begin_prepare( + self, + resource_group_name, # type: str + workspace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.NotebookResourceInfo"] + """prepare. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either NotebookResourceInfo or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, 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_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_prepare.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_operations.py index 7b558ec9d645..f3ea2f83e4bb 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_operations.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_operations.py @@ -1,101 +1,110 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class Operations(object): """Operations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.machinelearningservices.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2019-05-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all of the available Azure Machine Learning Workspaces REST API - operations. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Operation - :rtype: - ~azure.mgmt.machinelearningservices.models.OperationPaged[~azure.mgmt.machinelearningservices.models.Operation] - :raises: - :class:`MachineLearningServiceErrorException` + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OperationListResult"] + """Lists all of the available Azure Machine Learning Workspaces REST API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL - url = self.list.metadata['url'] - + url = self.list.metadata['url'] # type: ignore # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): request = prepare_request(next_link) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - raise models.MachineLearningServiceErrorException(self._deserialize, response) - - return response + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/providers/Microsoft.MachineLearningServices/operations'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.MachineLearningServices/operations'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_private_endpoint_connections_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..01e040f49d35 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,303 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +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 + + 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: Name of the resource group in which workspace is located. + :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 = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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 + + def put( + self, + resource_group_name, # type: str + workspace_name, # type: str + private_endpoint_connection_name, # type: str + private_endpoint=None, # type: Optional["models.PrivateEndpoint"] + private_link_service_connection_state=None, # type: Optional["models.PrivateLinkServiceConnectionState"] + **kwargs # type: Any + ): + # type: (...) -> "models.PrivateEndpointConnection" + """Update the state of specified private endpoint connection associated with the workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type private_link_service_connection_state: ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState + :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', {})) + + _properties = models.PrivateEndpointConnection(private_endpoint=private_endpoint, private_link_service_connection_state=private_link_service_connection_state) + api_version = "2020-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.put.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_properties, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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 + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + workspace_name, # type: str + private_endpoint_connection_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 = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + workspace_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified private endpoint connection associated with the workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, 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, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_private_link_resources_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..afa02c35e3a0 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_private_link_resources_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +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 + + def list_by_workspace( + 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: Name of the resource group in which workspace is located. + :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 = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self.list_by_workspace.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_quotas_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_quotas_operations.py new file mode 100644 index 000000000000..b96e6cb118c5 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_quotas_operations.py @@ -0,0 +1,183 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +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 + + def update( + self, + location, # type: str + value=None, # type: Optional[List["models.QuotaBaseProperties"]] + **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 value: The list for update quota. + :type value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] + :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', {})) + + _parameters = models.QuotaUpdateParameters(value=value) + api_version = "2020-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'QuotaUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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 + + def list( + self, + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ListWorkspaceQuotas"] + """Gets the currently assigned Workspace Quotas based on VMFamily. + + :param location: The location for which resource usage is queried. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListWorkspaceQuotas or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListWorkspaceQuotas"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListWorkspaceQuotas', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/Quotas'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_usages_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_usages_operations.py index 212fbc700f27..e5e4ae0eca89 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_usages_operations.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_usages_operations.py @@ -1,110 +1,118 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class UsagesOperations(object): """UsagesOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.machinelearningservices.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2019-05-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01" - - self.config = config + self._config = config def list( - self, location, custom_headers=None, raw=False, **operation_config): - """Gets the current usage information as well as limits for AML resources - for given subscription and location. + 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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Usage - :rtype: - ~azure.mgmt.machinelearningservices.models.UsagePaged[~azure.mgmt.machinelearningservices.models.Usage] - :raises: :class:`CloudError` + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListUsagesResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$') + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), } url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_virtual_machine_sizes_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_virtual_machine_sizes_operations.py index afbf3b4fc0b4..9e532d2ac52f 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_virtual_machine_sizes_operations.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_virtual_machine_sizes_operations.py @@ -1,100 +1,110 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class VirtualMachineSizesOperations(object): """VirtualMachineSizesOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.machinelearningservices.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2019-05-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01" - - self.config = config + self._config = config def list( - self, location, custom_headers=None, raw=False, **operation_config): + self, + location, # type: str + compute_type=None, # type: Optional[str] + recommended=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> "models.VirtualMachineSizeListResult" """Returns supported VM Sizes in a location. - :param location: The location upon which virtual-machine-sizes is - queried. + :param location: The location upon which virtual-machine-sizes is queried. :type location: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: VirtualMachineSizeListResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :param compute_type: Type of compute to filter by. + :type compute_type: str + :param recommended: Specifies whether to return recommended vm sizes or all vm sizes. + :type recommended: bool + :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 = "2020-08-01" + accept = "application/json" + # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if compute_type is not None: + query_parameters['compute-type'] = self._serialize.query("compute_type", compute_type, 'str') + if recommended is not None: + query_parameters['recommended'] = self._serialize.query("recommended", recommended, 'bool') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('VirtualMachineSizeListResult', response) + deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspace_connections_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspace_connections_operations.py new file mode 100644 index 000000000000..b05edb8a3b63 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspace_connections_operations.py @@ -0,0 +1,329 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +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 + + 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.PaginatedWorkspaceConnectionsList"] + """List all connections under a AML workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 PaginatedWorkspaceConnectionsList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedWorkspaceConnectionsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PaginatedWorkspaceConnectionsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if target is not None: + query_parameters['target'] = self._serialize.query("target", target, 'str') + if category is not None: + query_parameters['category'] = self._serialize.query("category", category, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PaginatedWorkspaceConnectionsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, 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 + + def create( + self, + resource_group_name, # type: str + workspace_name, # type: str + connection_name, # type: str + parameters, # type: "models.WorkspaceConnectionDto" + **kwargs # type: Any + ): + # type: (...) -> "models.WorkspaceConnection" + """Add a new workspace connection. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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.WorkspaceConnectionDto + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkspaceConnection, or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkspaceConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'WorkspaceConnectionDto') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WorkspaceConnection', 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 + + def get( + self, + resource_group_name, # type: str + workspace_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.WorkspaceConnection" + """Get the detail of a workspace connection. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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: WorkspaceConnection, or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkspaceConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WorkspaceConnection', 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 + + def delete( + self, + resource_group_name, # type: str + workspace_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a workspace connection. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 = "2020-08-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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 diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspace_features_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspace_features_operations.py new file mode 100644 index 000000000000..6e115f50ecc6 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspace_features_operations.py @@ -0,0 +1,122 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +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 + + 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: Name of the resource group in which workspace is located. + :type resource_group_name: str + :param workspace_name: Name of Azure Machine Learning workspace. + :type workspace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListAmlUserFeatureResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListAmlUserFeatureResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListAmlUserFeatureResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, 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/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspaces_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspaces_operations.py index 27bff19114d8..74e78c86b7cb 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspaces_operations.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspaces_operations.py @@ -1,555 +1,676 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class WorkspacesOperations(object): """WorkspacesOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.machinelearningservices.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2019-05-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01" - - self.config = config + self._config = config def get( - self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + 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: Name of the resource group in which - workspace is located. + :param resource_group_name: Name of the resource group in which workspace is located. :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Workspace or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.machinelearningservices.models.Workspace or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`MachineLearningServiceErrorException` + :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 = "2020-08-01" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str') + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - raise models.MachineLearningServiceErrorException(self._deserialize, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Workspace', response) + deserialized = self._deserialize('Workspace', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} - - def create_or_update( - self, resource_group_name, workspace_name, parameters, custom_headers=None, raw=False, **operation_config): - """Creates or updates a workspace with the specified parameters. + 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 = "2020-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" - :param resource_group_name: Name of the resource group in which - workspace is located. - :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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Workspace or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.machinelearningservices.models.Workspace or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`MachineLearningServiceErrorException` - """ # Construct URL - url = self.create_or_update.metadata['url'] + url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str') + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'Workspace') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Workspace') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response - if response.status_code not in [200, 201]: - raise models.MachineLearningServiceErrorException(self._deserialize, response) + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', response) + deserialized = self._deserialize('Workspace', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('Workspace', response) + deserialized = self._deserialize('Workspace', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} - - def delete( - self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): - """Deletes a machine learning workspace. + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + + 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: Name of the resource group in which - workspace is located. + :param resource_group_name: Name of the resource group in which workspace is located. :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`MachineLearningServiceErrorException` + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Workspace', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + workspace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + # Construct URL - url = self.delete.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str') + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if response.status_code not in [200, 204]: - raise models.MachineLearningServiceErrorException(self._deserialize, response) + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, 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 + + def begin_delete( + self, + resource_group_name, # type: str + workspace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a machine learning workspace. - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} + :param resource_group_name: Name of the resource group in which workspace is located. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore def update( - self, resource_group_name, workspace_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + workspace_name, # type: str + parameters, # type: "models.WorkspaceUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> "models.Workspace" """Updates a machine learning workspace with the specified parameters. - :param resource_group_name: Name of the resource group in which - workspace is located. + :param resource_group_name: Name of the resource group in which workspace is located. :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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Workspace or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.machinelearningservices.models.Workspace or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`MachineLearningServiceErrorException` + :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 + :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 = "2020-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.update.metadata['url'] + url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str') + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'WorkspaceUpdateParameters') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'WorkspaceUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - raise models.MachineLearningServiceErrorException(self._deserialize, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Workspace', response) + deserialized = self._deserialize('Workspace', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore def list_by_resource_group( - self, resource_group_name, skiptoken=None, custom_headers=None, raw=False, **operation_config): - """Lists all the available machine learning workspaces under the specified - resource group. - - :param resource_group_name: Name of the resource group in which - workspace is located. + self, + resource_group_name, # type: str + skiptoken=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: Name of the resource group in which workspace is located. :type resource_group_name: str :param skiptoken: Continuation token for pagination. :type skiptoken: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Workspace - :rtype: - ~azure.mgmt.machinelearningservices.models.WorkspacePaged[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: - :class:`MachineLearningServiceErrorException` + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkspaceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL - url = self.list_by_resource_group.metadata['url'] + url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') if skiptoken is not None: query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - raise models.MachineLearningServiceErrorException(self._deserialize, response) + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - return response + return pipeline_response - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.WorkspacePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces'} + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces'} # type: ignore def list_keys( - self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): - """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: Name of the resource group in which - workspace is located. + 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: Name of the resource group in which workspace is located. :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ListWorkspaceKeysResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`MachineLearningServiceErrorException` + :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 = "2020-08-01" + accept = "application/json" + # Construct URL - url = self.list_keys.metadata['url'] + url = self.list_keys.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str') + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - raise models.MachineLearningServiceErrorException(self._deserialize, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ListWorkspaceKeysResult', response) + deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys'} + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys'} # type: ignore def resync_keys( - self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): - """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: Name of the resource group in which - workspace is located. + self, + resource_group_name, # type: str + workspace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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: Name of the resource group in which workspace is located. :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`MachineLearningServiceErrorException` + :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 = "2020-08-01" + accept = "application/json" + # Construct URL - url = self.resync_keys.metadata['url'] + url = self.resync_keys.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str') + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - raise models.MachineLearningServiceErrorException(self._deserialize, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - resync_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} + resync_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} # type: ignore def list_by_subscription( - self, skiptoken=None, custom_headers=None, raw=False, **operation_config): - """Lists all the available machine learning workspaces under the specified - subscription. + self, + skiptoken=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.WorkspaceListResult"] + """Lists all the available machine learning workspaces under the specified subscription. :param skiptoken: Continuation token for pagination. :type skiptoken: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Workspace - :rtype: - ~azure.mgmt.machinelearningservices.models.WorkspacePaged[~azure.mgmt.machinelearningservices.models.Workspace] - :raises: - :class:`MachineLearningServiceErrorException` + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkspaceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-01" + accept = "application/json" + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL - url = self.list_by_subscription.metadata['url'] + url = self.list_by_subscription.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') if skiptoken is not None: query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - raise models.MachineLearningServiceErrorException(self._deserialize, response) + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - return response + return pipeline_response - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.WorkspacePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces'} + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces'} # type: ignore diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/py.typed b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/tests/test_mgmt_machinelearningservices.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/tests/test_mgmt_machinelearningservices.py new file mode 100644 index 000000000000..703e6fc764fd --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/tests/test_mgmt_machinelearningservices.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +import unittest + +from devtools_testutils import AzureMgmtTestCase, ResourceGroupPreparer +from azure.mgmt.machinelearningservices import AzureMachineLearningWorkspaces + +AZURE_LOCATION = 'eastus' + + +class MgmtMLServicesTest(AzureMgmtTestCase): + + def setUp(self): + super(MgmtMLServicesTest, self).setUp() + self.mgmt_client = self.create_mgmt_client(AzureMachineLearningWorkspaces) + + @ResourceGroupPreparer(location=AZURE_LOCATION) + def test_mlservices(self, resource_group): + self.mgmt_client.operations.list() + + +# ------------------------------------------------------------------------------ +if __name__ == '__main__': + unittest.main() diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/setup.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/setup.py index a30c32487f73..4cb5412a055f 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/setup.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/setup.py @@ -36,7 +36,7 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) From 7e1173e076f6a033eaef8811d575d703e949b093 Mon Sep 17 00:00:00 2001 From: msyyc <70930885+msyyc@users.noreply.github.com> Date: Fri, 23 Oct 2020 13:41:42 +0800 Subject: [PATCH 2/5] Update CHANGELOG.md --- .../azure-mgmt-machinelearningservices/CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/CHANGELOG.md b/sdk/machinelearning/azure-mgmt-machinelearningservices/CHANGELOG.md index bc02b5dffa2f..b59005ddcfe3 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/CHANGELOG.md +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/CHANGELOG.md @@ -3,7 +3,7 @@ ## 1.0.0b1 (2020-10-31) This is beta preview version. -For detailed changelog please refer to equivalent stable version 3.0.0 (https://pypi.org/project/azure-mgmt-machinelearningservices/0.1.0/) +For detailed changelog please refer to equivalent stable version 0.1.0 (https://pypi.org/project/azure-mgmt-machinelearningservices/0.1.0/) This version uses a next-generation code generator that introduces important breaking changes, but also important new features (like unified authentication and async programming). @@ -31,6 +31,6 @@ This version uses a next-generation code generator that introduces important bre - This client now support natively tracing library like OpenCensus or OpenTelemetry. See this [tracing quickstart](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/core/azure-core-tracing-opentelemetry) for an overview. -## 0.4.1 (2018-05-29) +## 0.1.0 (2019-06-27) - - Initial Release \ No newline at end of file + - Initial Release From b9014d759931ae2bb000998b064dcfece36007f7 Mon Sep 17 00:00:00 2001 From: msyyc <70930885+msyyc@users.noreply.github.com> Date: Fri, 23 Oct 2020 16:35:44 +0800 Subject: [PATCH 3/5] Update setup.py --- sdk/machinelearning/azure-mgmt-machinelearningservices/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/setup.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/setup.py index 4cb5412a055f..8ef79ba5f49b 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/setup.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/setup.py @@ -78,8 +78,8 @@ ]), install_requires=[ 'msrest>=0.5.0', - 'msrestazure>=0.4.32,<2.0.0', 'azure-common~=1.1', + 'azure-mgmt-core>=1.2.0,<2.0.0' ], extras_require={ ":python_version<'3.0'": ['azure-mgmt-nspkg'], From a4240045618ebb32f68c11e643903d2a4058b307 Mon Sep 17 00:00:00 2001 From: msyyc <70930885+msyyc@users.noreply.github.com> Date: Mon, 26 Oct 2020 16:55:06 +0800 Subject: [PATCH 4/5] Update README.md --- .../azure-mgmt-machinelearningservices/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/README.md b/sdk/machinelearning/azure-mgmt-machinelearningservices/README.md index 237e6e9f59d2..06a52c77e4a5 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/README.md +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/README.md @@ -1,5 +1,5 @@ ## Microsoft Azure SDK for Python - + This is the Microsoft Azure Machine Learning Services Management Client Library. From 80d17d5fa5ae5054ec58e33dba1251ac096b2f8b Mon Sep 17 00:00:00 2001 From: msyyc <70930885+msyyc@users.noreply.github.com> Date: Tue, 17 Nov 2020 16:06:32 +0800 Subject: [PATCH 5/5] Update README.md --- .../azure-mgmt-machinelearningservices/README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/README.md b/sdk/machinelearning/azure-mgmt-machinelearningservices/README.md index 06a52c77e4a5..1ff586a69f16 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/README.md +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/README.md @@ -15,11 +15,16 @@ library. For a more complete set of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). -## Usage +# Usage -For code examples, see [Machine Learning Services -Management](https://docs.microsoft.com/python/api/overview/azure/) on -docs.microsoft.com. + +To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) + + + +For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) +Code samples for this package can be found at [Machine Learning Services Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. +Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) ## Provide Feedback