From a4cd80096463c25feac066b6ede1d514a6999504 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 18 May 2021 09:24:41 +0000 Subject: [PATCH] CodeGen from PR 13736 in Azure/azure-rest-api-specs Merge 58efb8234114d48d89a1e8607b2ce5ef62259834 into 19e140f6f848bf9616735a7bd360edeef25c6c8d --- .../azure-mgmt-databricks/MANIFEST.in | 1 + .../azure-mgmt-databricks/_meta.json | 8 + .../azure/mgmt/databricks/_configuration.py | 1 - .../mgmt/databricks/_databricks_client.py | 29 ++- .../azure/mgmt/databricks/_metadata.json | 105 ++++++++ .../azure/mgmt/databricks/_version.py | 2 +- .../mgmt/databricks/aio/_configuration.py | 1 - .../mgmt/databricks/aio/_databricks_client.py | 28 +- .../databricks/aio/operations/__init__.py | 4 +- .../databricks/aio/operations/_operations.py | 4 +- .../operations/_vnet_peering_operations.py | 16 +- .../aio/operations/_workspaces_operations.py | 36 +-- .../azure/mgmt/databricks/models/__init__.py | 19 ++ .../models/_databricks_client_enums.py | 15 ++ .../azure/mgmt/databricks/models/_models.py | 216 ++++++++++++++- .../mgmt/databricks/models/_models_py3.py | 245 +++++++++++++++++- .../mgmt/databricks/operations/__init__.py | 4 +- .../mgmt/databricks/operations/_operations.py | 4 +- .../operations/_vnet_peering_operations.py | 16 +- .../operations/_workspaces_operations.py | 36 +-- 20 files changed, 704 insertions(+), 86 deletions(-) create mode 100644 sdk/databricks/azure-mgmt-databricks/_meta.json create mode 100644 sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/_metadata.json diff --git a/sdk/databricks/azure-mgmt-databricks/MANIFEST.in b/sdk/databricks/azure-mgmt-databricks/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/databricks/azure-mgmt-databricks/MANIFEST.in +++ b/sdk/databricks/azure-mgmt-databricks/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/databricks/azure-mgmt-databricks/_meta.json b/sdk/databricks/azure-mgmt-databricks/_meta.json new file mode 100644 index 000000000000..ac1f06f582fc --- /dev/null +++ b/sdk/databricks/azure-mgmt-databricks/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "3.4.2", + "use": "@autorest/python@5.6.6", + "commit": "eff7b55d76d8d4b8d9d7f6a4804640674301ba78", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/databricks/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.6.6 --version=3.4.2", + "readme": "specification/databricks/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/_configuration.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/_configuration.py index 6ecb0775935e..724254ad5ecc 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/_configuration.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/_configuration.py @@ -48,7 +48,6 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2018-04-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-databricks/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/_databricks_client.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/_databricks_client.py index 0c18f909b850..d1ad8c56b047 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/_databricks_client.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/_databricks_client.py @@ -16,11 +16,12 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import DatabricksClientConfiguration from .operations import WorkspacesOperations -from .operations import VNetPeeringOperations from .operations import Operations +from .operations import VNetPeeringOperations from . import models @@ -29,10 +30,10 @@ class DatabricksClient(object): :ivar workspaces: WorkspacesOperations operations :vartype workspaces: azure.mgmt.databricks.operations.WorkspacesOperations - :ivar vnet_peering: VNetPeeringOperations operations - :vartype vnet_peering: azure.mgmt.databricks.operations.VNetPeeringOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.databricks.operations.Operations + :ivar vnet_peering: VNetPeeringOperations operations + :vartype vnet_peering: azure.mgmt.databricks.operations.VNetPeeringOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. @@ -61,10 +62,28 @@ def __init__( self.workspaces = WorkspacesOperations( self._client, self._config, self._serialize, self._deserialize) - self.vnet_peering = VNetPeeringOperations( - self._client, self._config, self._serialize, self._deserialize) self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) + self.vnet_peering = VNetPeeringOperations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response def close(self): # type: () -> None diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/_metadata.json b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/_metadata.json new file mode 100644 index 000000000000..5dc7847afbb1 --- /dev/null +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/_metadata.json @@ -0,0 +1,105 @@ +{ + "chosen_version": "", + "total_api_version_list": ["2018-04-01", "2021-04-01-preview"], + "client": { + "name": "DatabricksClient", + "filename": "_databricks_client", + "description": "ARM Databricks.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DatabricksClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DatabricksClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "workspaces": "WorkspacesOperations", + "operations": "Operations", + "vnet_peering": "VNetPeeringOperations" + } +} \ No newline at end of file diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/_version.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/_version.py index c47f66669f1b..eae7c95b6fbd 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/_version.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "0.1.0" diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/_configuration.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/_configuration.py index 4be80d9ec7ce..222d6d3b4cfa 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/_configuration.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/_configuration.py @@ -45,7 +45,6 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2018-04-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-databricks/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/_databricks_client.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/_databricks_client.py index 1802066b532b..44f01f8e6527 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/_databricks_client.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/_databricks_client.py @@ -8,6 +8,7 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer @@ -17,8 +18,8 @@ from ._configuration import DatabricksClientConfiguration from .operations import WorkspacesOperations -from .operations import VNetPeeringOperations from .operations import Operations +from .operations import VNetPeeringOperations from .. import models @@ -27,10 +28,10 @@ class DatabricksClient(object): :ivar workspaces: WorkspacesOperations operations :vartype workspaces: azure.mgmt.databricks.aio.operations.WorkspacesOperations - :ivar vnet_peering: VNetPeeringOperations operations - :vartype vnet_peering: azure.mgmt.databricks.aio.operations.VNetPeeringOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.databricks.aio.operations.Operations + :ivar vnet_peering: VNetPeeringOperations operations + :vartype vnet_peering: azure.mgmt.databricks.aio.operations.VNetPeeringOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. @@ -58,10 +59,27 @@ def __init__( self.workspaces = WorkspacesOperations( self._client, self._config, self._serialize, self._deserialize) - self.vnet_peering = VNetPeeringOperations( - self._client, self._config, self._serialize, self._deserialize) self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) + self.vnet_peering = VNetPeeringOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response async def close(self) -> None: await self._client.close() diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/operations/__init__.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/operations/__init__.py index 7688e37c6383..6c2136aac6d5 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/operations/__init__.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/operations/__init__.py @@ -7,11 +7,11 @@ # -------------------------------------------------------------------------- from ._workspaces_operations import WorkspacesOperations -from ._vnet_peering_operations import VNetPeeringOperations from ._operations import Operations +from ._vnet_peering_operations import VNetPeeringOperations __all__ = [ 'WorkspacesOperations', - 'VNetPeeringOperations', 'Operations', + 'VNetPeeringOperations', ] diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/operations/_operations.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/operations/_operations.py index 2f053998c665..4e5d9e8cf467 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/operations/_operations.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/operations/_operations.py @@ -57,7 +57,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-04-01" + api_version = "2021-04-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -93,7 +93,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/operations/_vnet_peering_operations.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/operations/_vnet_peering_operations.py index 4b3ca5d6bc52..7c97edadee27 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/operations/_vnet_peering_operations.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/operations/_vnet_peering_operations.py @@ -95,7 +95,7 @@ async def get( 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -147,7 +147,7 @@ async def _delete_initial( 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -172,8 +172,8 @@ async def begin_delete( :type peering_name: str :keyword callable cls: A custom type or function 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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: 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) @@ -269,7 +269,7 @@ async def _create_or_update_initial( 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -305,8 +305,8 @@ async def begin_create_or_update( :type virtual_network_peering_parameters: ~azure.mgmt.databricks.models.VirtualNetworkPeering :keyword callable cls: A custom type or function 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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) @@ -425,7 +425,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/operations/_workspaces_operations.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/operations/_workspaces_operations.py index b9e02fa3ae05..a739215b8ba7 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/operations/_workspaces_operations.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/aio/operations/_workspaces_operations.py @@ -65,7 +65,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-04-01" + api_version = "2021-04-01-preview" accept = "application/json" # Construct URL @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Workspace', pipeline_response) @@ -113,7 +113,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-04-01" + api_version = "2021-04-01-preview" accept = "application/json" # Construct URL @@ -139,7 +139,7 @@ async def _delete_initial( 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -161,8 +161,8 @@ async def begin_delete( :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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: 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) @@ -223,7 +223,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-04-01" + api_version = "2021-04-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -254,7 +254,7 @@ async def _create_or_update_initial( 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -286,8 +286,8 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.databricks.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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: 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) @@ -352,7 +352,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-04-01" + api_version = "2021-04-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -383,7 +383,7 @@ async def _update_initial( 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -413,8 +413,8 @@ async def begin_update( :type parameters: ~azure.mgmt.databricks.models.WorkspaceUpdate :keyword callable cls: A custom type or function 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 + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: 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) @@ -486,7 +486,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-04-01" + api_version = "2021-04-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -527,7 +527,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -554,7 +554,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-04-01" + api_version = "2021-04-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -594,7 +594,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/__init__.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/__init__.py index 4804c264bf7a..e5e10422d7a9 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/__init__.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/__init__.py @@ -10,6 +10,9 @@ from ._models_py3 import AddressSpace from ._models_py3 import CreatedBy from ._models_py3 import Encryption + from ._models_py3 import EncryptionEntitiesDefinition + from ._models_py3 import EncryptionV2 + from ._models_py3 import EncryptionV2KeyVaultProperties from ._models_py3 import ErrorDetail from ._models_py3 import ErrorInfo from ._models_py3 import ErrorResponse @@ -19,6 +22,7 @@ from ._models_py3 import OperationListResult from ._models_py3 import Resource from ._models_py3 import Sku + from ._models_py3 import SystemData from ._models_py3 import TrackedResource from ._models_py3 import VirtualNetworkPeering from ._models_py3 import VirtualNetworkPeeringList @@ -31,12 +35,16 @@ from ._models_py3 import WorkspaceCustomStringParameter from ._models_py3 import WorkspaceEncryptionParameter from ._models_py3 import WorkspaceListResult + from ._models_py3 import WorkspacePropertiesEncryption from ._models_py3 import WorkspaceProviderAuthorization from ._models_py3 import WorkspaceUpdate except (SyntaxError, ImportError): from ._models import AddressSpace # type: ignore from ._models import CreatedBy # type: ignore from ._models import Encryption # type: ignore + from ._models import EncryptionEntitiesDefinition # type: ignore + from ._models import EncryptionV2 # type: ignore + from ._models import EncryptionV2KeyVaultProperties # type: ignore from ._models import ErrorDetail # type: ignore from ._models import ErrorInfo # type: ignore from ._models import ErrorResponse # type: ignore @@ -46,6 +54,7 @@ from ._models import OperationListResult # type: ignore from ._models import Resource # type: ignore from ._models import Sku # type: ignore + from ._models import SystemData # type: ignore from ._models import TrackedResource # type: ignore from ._models import VirtualNetworkPeering # type: ignore from ._models import VirtualNetworkPeeringList # type: ignore @@ -58,11 +67,14 @@ from ._models import WorkspaceCustomStringParameter # type: ignore from ._models import WorkspaceEncryptionParameter # type: ignore from ._models import WorkspaceListResult # type: ignore + from ._models import WorkspacePropertiesEncryption # type: ignore from ._models import WorkspaceProviderAuthorization # type: ignore from ._models import WorkspaceUpdate # type: ignore from ._databricks_client_enums import ( + CreatedByType, CustomParameterType, + EncryptionKeySource, KeySource, PeeringProvisioningState, PeeringState, @@ -73,6 +85,9 @@ 'AddressSpace', 'CreatedBy', 'Encryption', + 'EncryptionEntitiesDefinition', + 'EncryptionV2', + 'EncryptionV2KeyVaultProperties', 'ErrorDetail', 'ErrorInfo', 'ErrorResponse', @@ -82,6 +97,7 @@ 'OperationListResult', 'Resource', 'Sku', + 'SystemData', 'TrackedResource', 'VirtualNetworkPeering', 'VirtualNetworkPeeringList', @@ -94,9 +110,12 @@ 'WorkspaceCustomStringParameter', 'WorkspaceEncryptionParameter', 'WorkspaceListResult', + 'WorkspacePropertiesEncryption', 'WorkspaceProviderAuthorization', 'WorkspaceUpdate', + 'CreatedByType', 'CustomParameterType', + 'EncryptionKeySource', 'KeySource', 'PeeringProvisioningState', 'PeeringState', diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_databricks_client_enums.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_databricks_client_enums.py index 763ebf60815d..3346e563a010 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_databricks_client_enums.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_databricks_client_enums.py @@ -26,6 +26,15 @@ def __getattr__(cls, name): raise AttributeError(name) +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + class CustomParameterType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Provisioning status of the workspace. """ @@ -34,6 +43,12 @@ class CustomParameterType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): OBJECT = "Object" STRING = "String" +class EncryptionKeySource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Keyvault + """ + + MICROSOFT_KEYVAULT = "Microsoft.Keyvault" + class KeySource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The encryption keySource (provider). Possible values (case-insensitive): Default, Microsoft.Keyvault diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_models.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_models.py index 218574a66c4a..2108602a6421 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_models.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_models.py @@ -99,6 +99,90 @@ def __init__( self.key_vault_uri = kwargs.get('key_vault_uri', None) +class EncryptionEntitiesDefinition(msrest.serialization.Model): + """Encryption entities for databricks workspace resource. + + :param managed_services: Encryption properties for the databricks managed services. + :type managed_services: ~azure.mgmt.databricks.models.EncryptionV2 + """ + + _attribute_map = { + 'managed_services': {'key': 'managedServices', 'type': 'EncryptionV2'}, + } + + def __init__( + self, + **kwargs + ): + super(EncryptionEntitiesDefinition, self).__init__(**kwargs) + self.managed_services = kwargs.get('managed_services', None) + + +class EncryptionV2(msrest.serialization.Model): + """The object that contains details of encryption used on the workspace. + + All required parameters must be populated in order to send to Azure. + + :param key_source: Required. The encryption keySource (provider). Possible values + (case-insensitive): Microsoft.Keyvault. Possible values include: "Microsoft.Keyvault". + :type key_source: str or ~azure.mgmt.databricks.models.EncryptionKeySource + :param key_vault_properties: Key Vault input properties for encryption. + :type key_vault_properties: ~azure.mgmt.databricks.models.EncryptionV2KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionV2KeyVaultProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(EncryptionV2, self).__init__(**kwargs) + self.key_source = kwargs['key_source'] + self.key_vault_properties = kwargs.get('key_vault_properties', None) + + +class EncryptionV2KeyVaultProperties(msrest.serialization.Model): + """Key Vault input properties for encryption. + + All required parameters must be populated in order to send to Azure. + + :param key_vault_uri: Required. The Uri of KeyVault. + :type key_vault_uri: str + :param key_name: Required. The name of KeyVault key. + :type key_name: str + :param key_version: Required. The version of KeyVault key. + :type key_version: str + """ + + _validation = { + 'key_vault_uri': {'required': True}, + 'key_name': {'required': True}, + 'key_version': {'required': True}, + } + + _attribute_map = { + 'key_vault_uri': {'key': 'keyVaultUri', 'type': 'str'}, + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'key_version': {'key': 'keyVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EncryptionV2KeyVaultProperties, self).__init__(**kwargs) + self.key_vault_uri = kwargs['key_vault_uri'] + self.key_name = kwargs['key_name'] + self.key_version = kwargs['key_version'] + + class ErrorDetail(msrest.serialization.Model): """Error details. @@ -372,6 +456,47 @@ def __init__( self.tier = kwargs.get('tier', None) +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.databricks.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.databricks.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + class TrackedResource(Resource): """The resource model definition for a ARM tracked top level resource. @@ -445,15 +570,15 @@ class VirtualNetworkPeering(msrest.serialization.Model): true. This flag cannot be set if virtual network already has a gateway. :type use_remote_gateways: bool :param databricks_virtual_network: The remote virtual network should be in the same region. See - here to learn more (https://docs.microsoft.com/en-us/azure/databricks/administration- - guide/cloud-configurations/azure/vnet-peering). + here to learn more + (https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/vnet-peering). :type databricks_virtual_network: ~azure.mgmt.databricks.models.VirtualNetworkPeeringPropertiesFormatDatabricksVirtualNetwork :param databricks_address_space: The reference to the databricks virtual network address space. :type databricks_address_space: ~azure.mgmt.databricks.models.AddressSpace :param remote_virtual_network: Required. The remote virtual network should be in the same - region. See here to learn more (https://docs.microsoft.com/en- - us/azure/databricks/administration-guide/cloud-configurations/azure/vnet-peering). + region. See here to learn more + (https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/vnet-peering). :type remote_virtual_network: ~azure.mgmt.databricks.models.VirtualNetworkPeeringPropertiesFormatRemoteVirtualNetwork :param remote_address_space: The reference to the remote virtual network address space. @@ -594,6 +719,8 @@ class Workspace(TrackedResource): :type location: str :param sku: The SKU of the resource. :type sku: ~azure.mgmt.databricks.models.Sku + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.databricks.models.SystemData :param managed_resource_group_id: Required. The managed resource group Id. :type managed_resource_group_id: str :param parameters: The workspace's custom parameters. @@ -622,6 +749,8 @@ class Workspace(TrackedResource): :vartype workspace_url: str :param storage_account_identity: The details of Managed Identity of Storage Account. :type storage_account_identity: ~azure.mgmt.databricks.models.ManagedIdentityConfiguration + :param encryption: Encryption properties for databricks workspace. + :type encryption: ~azure.mgmt.databricks.models.WorkspacePropertiesEncryption """ _validation = { @@ -629,6 +758,7 @@ class Workspace(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'system_data': {'readonly': True}, 'managed_resource_group_id': {'required': True}, 'provisioning_state': {'readonly': True}, 'created_date_time': {'readonly': True}, @@ -643,6 +773,7 @@ class Workspace(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'managed_resource_group_id': {'key': 'properties.managedResourceGroupId', 'type': 'str'}, 'parameters': {'key': 'properties.parameters', 'type': 'WorkspaceCustomParameters'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, @@ -654,6 +785,7 @@ class Workspace(TrackedResource): 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, 'workspace_url': {'key': 'properties.workspaceUrl', 'type': 'str'}, 'storage_account_identity': {'key': 'properties.storageAccountIdentity', 'type': 'ManagedIdentityConfiguration'}, + 'encryption': {'key': 'properties.encryption', 'type': 'WorkspacePropertiesEncryption'}, } def __init__( @@ -662,6 +794,7 @@ def __init__( ): super(Workspace, self).__init__(**kwargs) self.sku = kwargs.get('sku', None) + self.system_data = None self.managed_resource_group_id = kwargs['managed_resource_group_id'] self.parameters = kwargs.get('parameters', None) self.provisioning_state = None @@ -673,6 +806,7 @@ def __init__( self.workspace_id = None self.workspace_url = None self.storage_account_identity = kwargs.get('storage_account_identity', None) + self.encryption = kwargs.get('encryption', None) class WorkspaceCustomBooleanParameter(msrest.serialization.Model): @@ -719,7 +853,7 @@ class WorkspaceCustomObjectParameter(msrest.serialization.Model): "String". :vartype type: str or ~azure.mgmt.databricks.models.CustomParameterType :param value: Required. The value which should be used for this field. - :type value: object + :type value: str """ _validation = { @@ -729,7 +863,7 @@ class WorkspaceCustomObjectParameter(msrest.serialization.Model): _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'object'}, + 'value': {'key': 'value', 'type': 'str'}, } def __init__( @@ -744,6 +878,8 @@ def __init__( class WorkspaceCustomParameters(msrest.serialization.Model): """Custom Parameters used for Cluster Creation. + Variables are only populated by the server, and will be ignored when sending a request. + :param aml_workspace_id: The ID of a Azure Machine Learning workspace to link with Databricks workspace. :type aml_workspace_id: ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter @@ -756,6 +892,18 @@ class WorkspaceCustomParameters(msrest.serialization.Model): :type custom_private_subnet_name: ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter :param enable_no_public_ip: Should the Public IP be Disabled?. :type enable_no_public_ip: ~azure.mgmt.databricks.models.WorkspaceCustomBooleanParameter + :param load_balancer_backend_pool_name: Name of the outbound Load Balancer Backend Pool for + Secure Cluster Connectivity (No Public IP). + :type load_balancer_backend_pool_name: + ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter + :param load_balancer_id: Resource URI of Outbound Load balancer for Secure Cluster Connectivity + (No Public IP) workspace. + :type load_balancer_id: ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter + :param nat_gateway_name: Name of the NAT gateway for Secure Cluster Connectivity (No Public IP) + workspace subnets. + :type nat_gateway_name: ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter + :param public_ip_name: Name of the Public IP for No Public IP workspace with managed vNet. + :type public_ip_name: ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter :param prepare_encryption: Prepare the workspace for encryption. Enables the Managed Identity for managed storage account. :type prepare_encryption: ~azure.mgmt.databricks.models.WorkspaceCustomBooleanParameter @@ -767,17 +915,40 @@ class WorkspaceCustomParameters(msrest.serialization.Model): data at rest. :type require_infrastructure_encryption: ~azure.mgmt.databricks.models.WorkspaceCustomBooleanParameter + :param storage_account_name: Default DBFS storage account name. + :type storage_account_name: ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter + :param storage_account_sku_name: Storage account SKU name, ex: Standard_GRS, Standard_LRS. + Refer https://aka.ms/storageskus for valid inputs. + :type storage_account_sku_name: ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter + :param vnet_address_prefix: Address prefix for Managed virtual network. Default value for this + input is 10.139. + :type vnet_address_prefix: ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter + :ivar resource_tags: Tags applied to resources under Managed resource group. These can be + updated by updating tags at workspace level. + :vartype resource_tags: ~azure.mgmt.databricks.models.WorkspaceCustomObjectParameter """ + _validation = { + 'resource_tags': {'readonly': True}, + } + _attribute_map = { 'aml_workspace_id': {'key': 'amlWorkspaceId', 'type': 'WorkspaceCustomStringParameter'}, 'custom_virtual_network_id': {'key': 'customVirtualNetworkId', 'type': 'WorkspaceCustomStringParameter'}, 'custom_public_subnet_name': {'key': 'customPublicSubnetName', 'type': 'WorkspaceCustomStringParameter'}, 'custom_private_subnet_name': {'key': 'customPrivateSubnetName', 'type': 'WorkspaceCustomStringParameter'}, 'enable_no_public_ip': {'key': 'enableNoPublicIp', 'type': 'WorkspaceCustomBooleanParameter'}, + 'load_balancer_backend_pool_name': {'key': 'loadBalancerBackendPoolName', 'type': 'WorkspaceCustomStringParameter'}, + 'load_balancer_id': {'key': 'loadBalancerId', 'type': 'WorkspaceCustomStringParameter'}, + 'nat_gateway_name': {'key': 'natGatewayName', 'type': 'WorkspaceCustomStringParameter'}, + 'public_ip_name': {'key': 'publicIpName', 'type': 'WorkspaceCustomStringParameter'}, 'prepare_encryption': {'key': 'prepareEncryption', 'type': 'WorkspaceCustomBooleanParameter'}, 'encryption': {'key': 'encryption', 'type': 'WorkspaceEncryptionParameter'}, 'require_infrastructure_encryption': {'key': 'requireInfrastructureEncryption', 'type': 'WorkspaceCustomBooleanParameter'}, + 'storage_account_name': {'key': 'storageAccountName', 'type': 'WorkspaceCustomStringParameter'}, + 'storage_account_sku_name': {'key': 'storageAccountSkuName', 'type': 'WorkspaceCustomStringParameter'}, + 'vnet_address_prefix': {'key': 'vnetAddressPrefix', 'type': 'WorkspaceCustomStringParameter'}, + 'resource_tags': {'key': 'resourceTags', 'type': 'WorkspaceCustomObjectParameter'}, } def __init__( @@ -790,9 +961,17 @@ def __init__( self.custom_public_subnet_name = kwargs.get('custom_public_subnet_name', None) self.custom_private_subnet_name = kwargs.get('custom_private_subnet_name', None) self.enable_no_public_ip = kwargs.get('enable_no_public_ip', None) + self.load_balancer_backend_pool_name = kwargs.get('load_balancer_backend_pool_name', None) + self.load_balancer_id = kwargs.get('load_balancer_id', None) + self.nat_gateway_name = kwargs.get('nat_gateway_name', None) + self.public_ip_name = kwargs.get('public_ip_name', None) self.prepare_encryption = kwargs.get('prepare_encryption', None) self.encryption = kwargs.get('encryption', None) self.require_infrastructure_encryption = kwargs.get('require_infrastructure_encryption', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.storage_account_sku_name = kwargs.get('storage_account_sku_name', None) + self.vnet_address_prefix = kwargs.get('vnet_address_prefix', None) + self.resource_tags = None class WorkspaceCustomStringParameter(msrest.serialization.Model): @@ -881,6 +1060,31 @@ def __init__( self.next_link = kwargs.get('next_link', None) +class WorkspacePropertiesEncryption(msrest.serialization.Model): + """Encryption properties for databricks workspace. + + All required parameters must be populated in order to send to Azure. + + :param entities: Required. Encryption entities definition for the workspace. + :type entities: ~azure.mgmt.databricks.models.EncryptionEntitiesDefinition + """ + + _validation = { + 'entities': {'required': True}, + } + + _attribute_map = { + 'entities': {'key': 'entities', 'type': 'EncryptionEntitiesDefinition'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkspacePropertiesEncryption, self).__init__(**kwargs) + self.entities = kwargs['entities'] + + class WorkspaceProviderAuthorization(msrest.serialization.Model): """The workspace provider authorization. diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_models_py3.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_models_py3.py index 95b0b518d8ce..275096b8c048 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_models_py3.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_models_py3.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import datetime from typing import Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError @@ -110,6 +111,99 @@ def __init__( self.key_vault_uri = key_vault_uri +class EncryptionEntitiesDefinition(msrest.serialization.Model): + """Encryption entities for databricks workspace resource. + + :param managed_services: Encryption properties for the databricks managed services. + :type managed_services: ~azure.mgmt.databricks.models.EncryptionV2 + """ + + _attribute_map = { + 'managed_services': {'key': 'managedServices', 'type': 'EncryptionV2'}, + } + + def __init__( + self, + *, + managed_services: Optional["EncryptionV2"] = None, + **kwargs + ): + super(EncryptionEntitiesDefinition, self).__init__(**kwargs) + self.managed_services = managed_services + + +class EncryptionV2(msrest.serialization.Model): + """The object that contains details of encryption used on the workspace. + + All required parameters must be populated in order to send to Azure. + + :param key_source: Required. The encryption keySource (provider). Possible values + (case-insensitive): Microsoft.Keyvault. Possible values include: "Microsoft.Keyvault". + :type key_source: str or ~azure.mgmt.databricks.models.EncryptionKeySource + :param key_vault_properties: Key Vault input properties for encryption. + :type key_vault_properties: ~azure.mgmt.databricks.models.EncryptionV2KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionV2KeyVaultProperties'}, + } + + def __init__( + self, + *, + key_source: Union[str, "EncryptionKeySource"], + key_vault_properties: Optional["EncryptionV2KeyVaultProperties"] = None, + **kwargs + ): + super(EncryptionV2, self).__init__(**kwargs) + self.key_source = key_source + self.key_vault_properties = key_vault_properties + + +class EncryptionV2KeyVaultProperties(msrest.serialization.Model): + """Key Vault input properties for encryption. + + All required parameters must be populated in order to send to Azure. + + :param key_vault_uri: Required. The Uri of KeyVault. + :type key_vault_uri: str + :param key_name: Required. The name of KeyVault key. + :type key_name: str + :param key_version: Required. The version of KeyVault key. + :type key_version: str + """ + + _validation = { + 'key_vault_uri': {'required': True}, + 'key_name': {'required': True}, + 'key_version': {'required': True}, + } + + _attribute_map = { + 'key_vault_uri': {'key': 'keyVaultUri', 'type': 'str'}, + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'key_version': {'key': 'keyVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + key_vault_uri: str, + key_name: str, + key_version: str, + **kwargs + ): + super(EncryptionV2KeyVaultProperties, self).__init__(**kwargs) + self.key_vault_uri = key_vault_uri + self.key_name = key_name + self.key_version = key_version + + class ErrorDetail(msrest.serialization.Model): """Error details. @@ -407,6 +501,54 @@ def __init__( self.tier = tier +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.databricks.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.databricks.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + class TrackedResource(Resource): """The resource model definition for a ARM tracked top level resource. @@ -483,15 +625,15 @@ class VirtualNetworkPeering(msrest.serialization.Model): true. This flag cannot be set if virtual network already has a gateway. :type use_remote_gateways: bool :param databricks_virtual_network: The remote virtual network should be in the same region. See - here to learn more (https://docs.microsoft.com/en-us/azure/databricks/administration- - guide/cloud-configurations/azure/vnet-peering). + here to learn more + (https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/vnet-peering). :type databricks_virtual_network: ~azure.mgmt.databricks.models.VirtualNetworkPeeringPropertiesFormatDatabricksVirtualNetwork :param databricks_address_space: The reference to the databricks virtual network address space. :type databricks_address_space: ~azure.mgmt.databricks.models.AddressSpace :param remote_virtual_network: Required. The remote virtual network should be in the same - region. See here to learn more (https://docs.microsoft.com/en- - us/azure/databricks/administration-guide/cloud-configurations/azure/vnet-peering). + region. See here to learn more + (https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/vnet-peering). :type remote_virtual_network: ~azure.mgmt.databricks.models.VirtualNetworkPeeringPropertiesFormatRemoteVirtualNetwork :param remote_address_space: The reference to the remote virtual network address space. @@ -648,6 +790,8 @@ class Workspace(TrackedResource): :type location: str :param sku: The SKU of the resource. :type sku: ~azure.mgmt.databricks.models.Sku + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.databricks.models.SystemData :param managed_resource_group_id: Required. The managed resource group Id. :type managed_resource_group_id: str :param parameters: The workspace's custom parameters. @@ -676,6 +820,8 @@ class Workspace(TrackedResource): :vartype workspace_url: str :param storage_account_identity: The details of Managed Identity of Storage Account. :type storage_account_identity: ~azure.mgmt.databricks.models.ManagedIdentityConfiguration + :param encryption: Encryption properties for databricks workspace. + :type encryption: ~azure.mgmt.databricks.models.WorkspacePropertiesEncryption """ _validation = { @@ -683,6 +829,7 @@ class Workspace(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'system_data': {'readonly': True}, 'managed_resource_group_id': {'required': True}, 'provisioning_state': {'readonly': True}, 'created_date_time': {'readonly': True}, @@ -697,6 +844,7 @@ class Workspace(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'managed_resource_group_id': {'key': 'properties.managedResourceGroupId', 'type': 'str'}, 'parameters': {'key': 'properties.parameters', 'type': 'WorkspaceCustomParameters'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, @@ -708,6 +856,7 @@ class Workspace(TrackedResource): 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, 'workspace_url': {'key': 'properties.workspaceUrl', 'type': 'str'}, 'storage_account_identity': {'key': 'properties.storageAccountIdentity', 'type': 'ManagedIdentityConfiguration'}, + 'encryption': {'key': 'properties.encryption', 'type': 'WorkspacePropertiesEncryption'}, } def __init__( @@ -723,10 +872,12 @@ def __init__( created_by: Optional["CreatedBy"] = None, updated_by: Optional["CreatedBy"] = None, storage_account_identity: Optional["ManagedIdentityConfiguration"] = None, + encryption: Optional["WorkspacePropertiesEncryption"] = None, **kwargs ): super(Workspace, self).__init__(tags=tags, location=location, **kwargs) self.sku = sku + self.system_data = None self.managed_resource_group_id = managed_resource_group_id self.parameters = parameters self.provisioning_state = None @@ -738,6 +889,7 @@ def __init__( self.workspace_id = None self.workspace_url = None self.storage_account_identity = storage_account_identity + self.encryption = encryption class WorkspaceCustomBooleanParameter(msrest.serialization.Model): @@ -786,7 +938,7 @@ class WorkspaceCustomObjectParameter(msrest.serialization.Model): "String". :vartype type: str or ~azure.mgmt.databricks.models.CustomParameterType :param value: Required. The value which should be used for this field. - :type value: object + :type value: str """ _validation = { @@ -796,13 +948,13 @@ class WorkspaceCustomObjectParameter(msrest.serialization.Model): _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'object'}, + 'value': {'key': 'value', 'type': 'str'}, } def __init__( self, *, - value: object, + value: str, **kwargs ): super(WorkspaceCustomObjectParameter, self).__init__(**kwargs) @@ -813,6 +965,8 @@ def __init__( class WorkspaceCustomParameters(msrest.serialization.Model): """Custom Parameters used for Cluster Creation. + Variables are only populated by the server, and will be ignored when sending a request. + :param aml_workspace_id: The ID of a Azure Machine Learning workspace to link with Databricks workspace. :type aml_workspace_id: ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter @@ -825,6 +979,18 @@ class WorkspaceCustomParameters(msrest.serialization.Model): :type custom_private_subnet_name: ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter :param enable_no_public_ip: Should the Public IP be Disabled?. :type enable_no_public_ip: ~azure.mgmt.databricks.models.WorkspaceCustomBooleanParameter + :param load_balancer_backend_pool_name: Name of the outbound Load Balancer Backend Pool for + Secure Cluster Connectivity (No Public IP). + :type load_balancer_backend_pool_name: + ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter + :param load_balancer_id: Resource URI of Outbound Load balancer for Secure Cluster Connectivity + (No Public IP) workspace. + :type load_balancer_id: ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter + :param nat_gateway_name: Name of the NAT gateway for Secure Cluster Connectivity (No Public IP) + workspace subnets. + :type nat_gateway_name: ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter + :param public_ip_name: Name of the Public IP for No Public IP workspace with managed vNet. + :type public_ip_name: ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter :param prepare_encryption: Prepare the workspace for encryption. Enables the Managed Identity for managed storage account. :type prepare_encryption: ~azure.mgmt.databricks.models.WorkspaceCustomBooleanParameter @@ -836,17 +1002,40 @@ class WorkspaceCustomParameters(msrest.serialization.Model): data at rest. :type require_infrastructure_encryption: ~azure.mgmt.databricks.models.WorkspaceCustomBooleanParameter + :param storage_account_name: Default DBFS storage account name. + :type storage_account_name: ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter + :param storage_account_sku_name: Storage account SKU name, ex: Standard_GRS, Standard_LRS. + Refer https://aka.ms/storageskus for valid inputs. + :type storage_account_sku_name: ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter + :param vnet_address_prefix: Address prefix for Managed virtual network. Default value for this + input is 10.139. + :type vnet_address_prefix: ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter + :ivar resource_tags: Tags applied to resources under Managed resource group. These can be + updated by updating tags at workspace level. + :vartype resource_tags: ~azure.mgmt.databricks.models.WorkspaceCustomObjectParameter """ + _validation = { + 'resource_tags': {'readonly': True}, + } + _attribute_map = { 'aml_workspace_id': {'key': 'amlWorkspaceId', 'type': 'WorkspaceCustomStringParameter'}, 'custom_virtual_network_id': {'key': 'customVirtualNetworkId', 'type': 'WorkspaceCustomStringParameter'}, 'custom_public_subnet_name': {'key': 'customPublicSubnetName', 'type': 'WorkspaceCustomStringParameter'}, 'custom_private_subnet_name': {'key': 'customPrivateSubnetName', 'type': 'WorkspaceCustomStringParameter'}, 'enable_no_public_ip': {'key': 'enableNoPublicIp', 'type': 'WorkspaceCustomBooleanParameter'}, + 'load_balancer_backend_pool_name': {'key': 'loadBalancerBackendPoolName', 'type': 'WorkspaceCustomStringParameter'}, + 'load_balancer_id': {'key': 'loadBalancerId', 'type': 'WorkspaceCustomStringParameter'}, + 'nat_gateway_name': {'key': 'natGatewayName', 'type': 'WorkspaceCustomStringParameter'}, + 'public_ip_name': {'key': 'publicIpName', 'type': 'WorkspaceCustomStringParameter'}, 'prepare_encryption': {'key': 'prepareEncryption', 'type': 'WorkspaceCustomBooleanParameter'}, 'encryption': {'key': 'encryption', 'type': 'WorkspaceEncryptionParameter'}, 'require_infrastructure_encryption': {'key': 'requireInfrastructureEncryption', 'type': 'WorkspaceCustomBooleanParameter'}, + 'storage_account_name': {'key': 'storageAccountName', 'type': 'WorkspaceCustomStringParameter'}, + 'storage_account_sku_name': {'key': 'storageAccountSkuName', 'type': 'WorkspaceCustomStringParameter'}, + 'vnet_address_prefix': {'key': 'vnetAddressPrefix', 'type': 'WorkspaceCustomStringParameter'}, + 'resource_tags': {'key': 'resourceTags', 'type': 'WorkspaceCustomObjectParameter'}, } def __init__( @@ -857,9 +1046,16 @@ def __init__( custom_public_subnet_name: Optional["WorkspaceCustomStringParameter"] = None, custom_private_subnet_name: Optional["WorkspaceCustomStringParameter"] = None, enable_no_public_ip: Optional["WorkspaceCustomBooleanParameter"] = None, + load_balancer_backend_pool_name: Optional["WorkspaceCustomStringParameter"] = None, + load_balancer_id: Optional["WorkspaceCustomStringParameter"] = None, + nat_gateway_name: Optional["WorkspaceCustomStringParameter"] = None, + public_ip_name: Optional["WorkspaceCustomStringParameter"] = None, prepare_encryption: Optional["WorkspaceCustomBooleanParameter"] = None, encryption: Optional["WorkspaceEncryptionParameter"] = None, require_infrastructure_encryption: Optional["WorkspaceCustomBooleanParameter"] = None, + storage_account_name: Optional["WorkspaceCustomStringParameter"] = None, + storage_account_sku_name: Optional["WorkspaceCustomStringParameter"] = None, + vnet_address_prefix: Optional["WorkspaceCustomStringParameter"] = None, **kwargs ): super(WorkspaceCustomParameters, self).__init__(**kwargs) @@ -868,9 +1064,17 @@ def __init__( self.custom_public_subnet_name = custom_public_subnet_name self.custom_private_subnet_name = custom_private_subnet_name self.enable_no_public_ip = enable_no_public_ip + self.load_balancer_backend_pool_name = load_balancer_backend_pool_name + self.load_balancer_id = load_balancer_id + self.nat_gateway_name = nat_gateway_name + self.public_ip_name = public_ip_name self.prepare_encryption = prepare_encryption self.encryption = encryption self.require_infrastructure_encryption = require_infrastructure_encryption + self.storage_account_name = storage_account_name + self.storage_account_sku_name = storage_account_sku_name + self.vnet_address_prefix = vnet_address_prefix + self.resource_tags = None class WorkspaceCustomStringParameter(msrest.serialization.Model): @@ -966,6 +1170,33 @@ def __init__( self.next_link = next_link +class WorkspacePropertiesEncryption(msrest.serialization.Model): + """Encryption properties for databricks workspace. + + All required parameters must be populated in order to send to Azure. + + :param entities: Required. Encryption entities definition for the workspace. + :type entities: ~azure.mgmt.databricks.models.EncryptionEntitiesDefinition + """ + + _validation = { + 'entities': {'required': True}, + } + + _attribute_map = { + 'entities': {'key': 'entities', 'type': 'EncryptionEntitiesDefinition'}, + } + + def __init__( + self, + *, + entities: "EncryptionEntitiesDefinition", + **kwargs + ): + super(WorkspacePropertiesEncryption, self).__init__(**kwargs) + self.entities = entities + + class WorkspaceProviderAuthorization(msrest.serialization.Model): """The workspace provider authorization. diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/__init__.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/__init__.py index 7688e37c6383..6c2136aac6d5 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/__init__.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/__init__.py @@ -7,11 +7,11 @@ # -------------------------------------------------------------------------- from ._workspaces_operations import WorkspacesOperations -from ._vnet_peering_operations import VNetPeeringOperations from ._operations import Operations +from ._vnet_peering_operations import VNetPeeringOperations __all__ = [ 'WorkspacesOperations', - 'VNetPeeringOperations', 'Operations', + 'VNetPeeringOperations', ] diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/_operations.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/_operations.py index 19aa0562dc18..f3fe85fc3da2 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/_operations.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/_operations.py @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-04-01" + api_version = "2021-04-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -98,7 +98,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/_vnet_peering_operations.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/_vnet_peering_operations.py index c80b1a69ad44..cea1a4d0e33d 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/_vnet_peering_operations.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/_vnet_peering_operations.py @@ -100,7 +100,7 @@ def get( 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -153,7 +153,7 @@ def _delete_initial( 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -179,8 +179,8 @@ def begin_delete( :type peering_name: str :keyword callable cls: A custom type or function 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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: 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) @@ -277,7 +277,7 @@ def _create_or_update_initial( 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -314,8 +314,8 @@ def begin_create_or_update( :type virtual_network_peering_parameters: ~azure.mgmt.databricks.models.VirtualNetworkPeering :keyword callable cls: A custom type or function 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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either VirtualNetworkPeering or the result of cls(response) @@ -435,7 +435,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/_workspaces_operations.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/_workspaces_operations.py index bcfd38c1fff1..cc8b4fbfd2fd 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/_workspaces_operations.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/_workspaces_operations.py @@ -70,7 +70,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-04-01" + api_version = "2021-04-01-preview" accept = "application/json" # Construct URL @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Workspace', pipeline_response) @@ -119,7 +119,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-04-01" + api_version = "2021-04-01-preview" accept = "application/json" # Construct URL @@ -145,7 +145,7 @@ def _delete_initial( 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -168,8 +168,8 @@ def begin_delete( :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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: 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) @@ -231,7 +231,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-04-01" + api_version = "2021-04-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -262,7 +262,7 @@ def _create_or_update_initial( 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,8 +295,8 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.databricks.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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: 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) @@ -362,7 +362,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-04-01" + api_version = "2021-04-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -393,7 +393,7 @@ def _update_initial( 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.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -424,8 +424,8 @@ def begin_update( :type parameters: ~azure.mgmt.databricks.models.WorkspaceUpdate :keyword callable cls: A custom type or function 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 + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: 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) @@ -498,7 +498,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-04-01" + api_version = "2021-04-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -539,7 +539,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -567,7 +567,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-04-01" + api_version = "2021-04-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -607,7 +607,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)