From 2eeb1472bb75ff8163b8dad970524b69e9adbbe1 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 1 Jun 2021 02:31:44 +0000 Subject: [PATCH] CodeGen from PR 14604 in Azure/azure-rest-api-specs Hdinsight t2 config (#14604) * sql t2 readme config * readme config * Update readme.python.md * conflient resolve * readme t2 config * modelerfour config * Update readme.python.md Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> --- .../azure-mgmt-hdinsight/MANIFEST.in | 1 + sdk/hdinsight/azure-mgmt-hdinsight/_meta.json | 11 + .../_hd_insight_management_client.py | 19 + .../azure/mgmt/hdinsight/_metadata.json | 111 ++ .../azure/mgmt/hdinsight/_version.py | 2 +- .../aio/_hd_insight_management_client.py | 18 + .../operations/_applications_operations.py | 101 +- .../aio/operations/_clusters_operations.py | 290 +++++- .../operations/_configurations_operations.py | 20 +- .../aio/operations/_extensions_operations.py | 424 +++++++- .../aio/operations/_locations_operations.py | 197 +++- .../hdinsight/aio/operations/_operations.py | 4 +- .../operations/_script_actions_operations.py | 77 +- .../_script_execution_history_operations.py | 8 +- .../_virtual_machines_operations.py | 79 +- .../azure/mgmt/hdinsight/models/__init__.py | 57 +- .../_hd_insight_management_client_enums.py | 2 + .../azure/mgmt/hdinsight/models/_models.py | 823 +++++++++++++-- .../mgmt/hdinsight/models/_models_py3.py | 952 ++++++++++++++++-- .../operations/_applications_operations.py | 90 +- .../operations/_clusters_operations.py | 255 ++++- .../operations/_configurations_operations.py | 12 +- .../operations/_extensions_operations.py | 410 +++++++- .../operations/_locations_operations.py | 194 +++- .../mgmt/hdinsight/operations/_operations.py | 2 +- .../operations/_script_actions_operations.py | 72 +- .../_script_execution_history_operations.py | 4 +- .../_virtual_machines_operations.py | 74 +- 28 files changed, 3896 insertions(+), 413 deletions(-) create mode 100644 sdk/hdinsight/azure-mgmt-hdinsight/_meta.json create mode 100644 sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/_metadata.json diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/MANIFEST.in b/sdk/hdinsight/azure-mgmt-hdinsight/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/MANIFEST.in +++ b/sdk/hdinsight/azure-mgmt-hdinsight/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/_meta.json b/sdk/hdinsight/azure-mgmt-hdinsight/_meta.json new file mode 100644 index 000000000000..9b927b1d2f00 --- /dev/null +++ b/sdk/hdinsight/azure-mgmt-hdinsight/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.4.2", + "use": [ + "@autorest/python@5.8.0", + "@autorest/modelerfour@4.19.2" + ], + "commit": "6a38cb16662cd02a3659665f9242d5ce011e032e", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/hdinsight/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.8.0 --use=@autorest/modelerfour@4.19.2 --version=3.4.2", + "readme": "specification/hdinsight/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/_hd_insight_management_client.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/_hd_insight_management_client.py index 0932437c3d84..7236d5e28fda 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/_hd_insight_management_client.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/_hd_insight_management_client.py @@ -16,6 +16,7 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import HDInsightManagementClientConfiguration from .operations import ClustersOperations @@ -96,6 +97,24 @@ def __init__( self.virtual_machines = VirtualMachinesOperations( 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 self._client.close() diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/_metadata.json b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/_metadata.json new file mode 100644 index 000000000000..c8cda88548d1 --- /dev/null +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/_metadata.json @@ -0,0 +1,111 @@ +{ + "chosen_version": "2018-06-01-preview", + "total_api_version_list": ["2018-06-01-preview"], + "client": { + "name": "HDInsightManagementClient", + "filename": "_hd_insight_management_client", + "description": "HDInsight Management Client.", + "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\": [\"HDInsightManagementClientConfiguration\"]}}, \"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\": [\"HDInsightManagementClientConfiguration\"]}}, \"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 subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "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 subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "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": { + "clusters": "ClustersOperations", + "applications": "ApplicationsOperations", + "locations": "LocationsOperations", + "configurations": "ConfigurationsOperations", + "extensions": "ExtensionsOperations", + "script_actions": "ScriptActionsOperations", + "script_execution_history": "ScriptExecutionHistoryOperations", + "operations": "Operations", + "virtual_machines": "VirtualMachinesOperations" + } +} \ No newline at end of file diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/_version.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/_version.py index 364f3c906cf9..e5754a47ce68 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/_version.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "7.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/_hd_insight_management_client.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/_hd_insight_management_client.py index b7498fb27bf7..fd0ff2a8c44e 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/_hd_insight_management_client.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/_hd_insight_management_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 @@ -93,6 +94,23 @@ def __init__( self.virtual_machines = VirtualMachinesOperations( 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/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_applications_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_applications_operations.py index 1a1ba05c111e..addf735481ba 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_applications_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_applications_operations.py @@ -47,7 +47,7 @@ def list_by_cluster( self, resource_group_name: str, cluster_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ApplicationListResult"]: """Lists all of the applications for the HDInsight cluster. @@ -107,7 +107,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) @@ -123,7 +123,7 @@ async def get( resource_group_name: str, cluster_name: str, application_name: str, - **kwargs + **kwargs: Any ) -> "_models.Application": """Gets properties of the specified application. @@ -170,7 +170,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('Application', pipeline_response) @@ -187,7 +187,7 @@ async def _create_initial( cluster_name: str, application_name: str, parameters: "_models.Application", - **kwargs + **kwargs: Any ) -> "_models.Application": cls = kwargs.pop('cls', None) # type: ClsType["_models.Application"] error_map = { @@ -226,7 +226,7 @@ async def _create_initial( 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('Application', pipeline_response) @@ -243,7 +243,7 @@ async def begin_create( cluster_name: str, application_name: str, parameters: "_models.Application", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.Application"]: """Creates applications for the HDInsight cluster. @@ -257,8 +257,8 @@ async def begin_create( :type parameters: ~azure.mgmt.hdinsight.models.Application :keyword callable cls: A custom type or function 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either Application or the result of cls(response) @@ -299,7 +299,7 @@ def get_long_running_output(pipeline_response): 'applicationName': self._serialize.url("application_name", application_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -318,7 +318,7 @@ async def _delete_initial( resource_group_name: str, cluster_name: str, application_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -350,9 +350,9 @@ async def _delete_initial( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 202]: + 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: @@ -365,7 +365,7 @@ async def begin_delete( resource_group_name: str, cluster_name: str, application_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes the specified application on the HDInsight cluster. @@ -377,8 +377,8 @@ async def begin_delete( :type application_name: str :keyword callable cls: A custom type or function 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: 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) @@ -415,7 +415,7 @@ def get_long_running_output(pipeline_response): 'applicationName': self._serialize.url("application_name", application_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -428,3 +428,70 @@ def get_long_running_output(pipeline_response): else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}'} # type: ignore + + async def get_azure_async_operation_status( + self, + resource_group_name: str, + cluster_name: str, + application_name: str, + operation_id: str, + **kwargs: Any + ) -> "_models.AsyncOperationResult": + """Gets the async operation status. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param application_name: The constant value for the application name. + :type application_name: str + :param operation_id: The long running operation id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AsyncOperationResult, or the result of cls(response) + :rtype: ~azure.mgmt.hdinsight.models.AsyncOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AsyncOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_azure_async_operation_status.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'applicationName': self._serialize.url("application_name", application_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_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['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.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AsyncOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_azure_async_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}/azureasyncoperations/{operationId}'} # type: ignore diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_clusters_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_clusters_operations.py index 7c88497674ba..2d54ce0bcf10 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_clusters_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_clusters_operations.py @@ -48,7 +48,7 @@ async def _create_initial( resource_group_name: str, cluster_name: str, parameters: "_models.ClusterCreateParametersExtended", - **kwargs + **kwargs: Any ) -> "_models.Cluster": cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] error_map = { @@ -86,7 +86,7 @@ async def _create_initial( 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('Cluster', pipeline_response) @@ -102,7 +102,7 @@ async def begin_create( resource_group_name: str, cluster_name: str, parameters: "_models.ClusterCreateParametersExtended", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.Cluster"]: """Creates a new HDInsight cluster with the specified parameters. @@ -114,8 +114,8 @@ async def begin_create( :type parameters: ~azure.mgmt.hdinsight.models.ClusterCreateParametersExtended :keyword callable cls: A custom type or function 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either Cluster or the result of cls(response) @@ -154,7 +154,7 @@ def get_long_running_output(pipeline_response): 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -173,7 +173,7 @@ async def update( resource_group_name: str, cluster_name: str, parameters: "_models.ClusterPatchParameters", - **kwargs + **kwargs: Any ) -> "_models.Cluster": """Patch HDInsight cluster with the specified parameters. @@ -224,7 +224,7 @@ async def update( 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('Cluster', pipeline_response) @@ -239,7 +239,7 @@ async def _delete_initial( self, resource_group_name: str, cluster_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -270,9 +270,9 @@ async def _delete_initial( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 202]: + 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: @@ -284,7 +284,7 @@ async def begin_delete( self, resource_group_name: str, cluster_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes the specified HDInsight cluster. @@ -294,8 +294,8 @@ async def begin_delete( :type cluster_name: str :keyword callable cls: A custom type or function 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: 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) @@ -330,7 +330,7 @@ def get_long_running_output(pipeline_response): 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -348,7 +348,7 @@ async def get( self, resource_group_name: str, cluster_name: str, - **kwargs + **kwargs: Any ) -> "_models.Cluster": """Gets the specified cluster. @@ -392,7 +392,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('Cluster', pipeline_response) @@ -406,7 +406,7 @@ async def get( def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ClusterListResult"]: """Lists the HDInsight clusters in a resource group. @@ -463,7 +463,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) @@ -480,7 +480,7 @@ async def _resize_initial( cluster_name: str, role_name: Union[str, "_models.RoleName"], parameters: "_models.ClusterResizeParameters", - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -519,7 +519,7 @@ async def _resize_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) if cls: @@ -533,7 +533,7 @@ async def begin_resize( cluster_name: str, role_name: Union[str, "_models.RoleName"], parameters: "_models.ClusterResizeParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Resizes the specified HDInsight cluster to the specified size. @@ -547,8 +547,8 @@ async def begin_resize( :type parameters: ~azure.mgmt.hdinsight.models.ClusterResizeParameters :keyword callable cls: A custom type or function 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: 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) @@ -586,7 +586,7 @@ def get_long_running_output(pipeline_response): 'roleName': self._serialize.url("role_name", role_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -606,7 +606,7 @@ async def _update_auto_scale_configuration_initial( cluster_name: str, role_name: Union[str, "_models.RoleName"], parameters: "_models.AutoscaleConfigurationUpdateParameter", - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -645,7 +645,7 @@ async def _update_auto_scale_configuration_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) if cls: @@ -659,7 +659,7 @@ async def begin_update_auto_scale_configuration( cluster_name: str, role_name: Union[str, "_models.RoleName"], parameters: "_models.AutoscaleConfigurationUpdateParameter", - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Updates the Autoscale Configuration for HDInsight cluster. @@ -673,8 +673,8 @@ async def begin_update_auto_scale_configuration( :type parameters: ~azure.mgmt.hdinsight.models.AutoscaleConfigurationUpdateParameter :keyword callable cls: A custom type or function 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: 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) @@ -712,7 +712,7 @@ def get_long_running_output(pipeline_response): 'roleName': self._serialize.url("role_name", role_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -728,7 +728,7 @@ def get_long_running_output(pipeline_response): def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ClusterListResult"]: """Lists all the HDInsight clusters under the subscription. @@ -782,7 +782,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) @@ -798,7 +798,7 @@ async def _rotate_disk_encryption_key_initial( resource_group_name: str, cluster_name: str, parameters: "_models.ClusterDiskEncryptionParameters", - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -836,7 +836,7 @@ async def _rotate_disk_encryption_key_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) if cls: @@ -849,7 +849,7 @@ async def begin_rotate_disk_encryption_key( resource_group_name: str, cluster_name: str, parameters: "_models.ClusterDiskEncryptionParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Rotate disk encryption key of the specified HDInsight cluster. @@ -861,8 +861,8 @@ async def begin_rotate_disk_encryption_key( :type parameters: ~azure.mgmt.hdinsight.models.ClusterDiskEncryptionParameters :keyword callable cls: A custom type or function 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: 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) @@ -898,7 +898,7 @@ def get_long_running_output(pipeline_response): 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -916,7 +916,7 @@ async def get_gateway_settings( self, resource_group_name: str, cluster_name: str, - **kwargs + **kwargs: Any ) -> "_models.GatewaySettings": """Gets the gateway settings for the specified cluster. @@ -960,7 +960,7 @@ async def get_gateway_settings( 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('GatewaySettings', pipeline_response) @@ -976,7 +976,7 @@ async def _update_gateway_settings_initial( resource_group_name: str, cluster_name: str, parameters: "_models.UpdateGatewaySettingsParameters", - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -1014,7 +1014,7 @@ async def _update_gateway_settings_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) if cls: @@ -1027,7 +1027,7 @@ async def begin_update_gateway_settings( resource_group_name: str, cluster_name: str, parameters: "_models.UpdateGatewaySettingsParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Configures the gateway settings on the specified cluster. @@ -1039,8 +1039,8 @@ async def begin_update_gateway_settings( :type parameters: ~azure.mgmt.hdinsight.models.UpdateGatewaySettingsParameters :keyword callable cls: A custom type or function 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: 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) @@ -1076,7 +1076,7 @@ def get_long_running_output(pipeline_response): 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1090,12 +1090,194 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_update_gateway_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/updateGatewaySettings'} # type: ignore + async def get_azure_async_operation_status( + self, + resource_group_name: str, + cluster_name: str, + operation_id: str, + **kwargs: Any + ) -> "_models.AsyncOperationResult": + """The the async operation status. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param operation_id: The long running operation id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AsyncOperationResult, or the result of cls(response) + :rtype: ~azure.mgmt.hdinsight.models.AsyncOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AsyncOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_azure_async_operation_status.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_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['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.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AsyncOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_azure_async_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/azureasyncoperations/{operationId}'} # type: ignore + + async def _update_identity_certificate_initial( + self, + resource_group_name: str, + cluster_name: str, + parameters: "_models.UpdateClusterIdentityCertificateParameters", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_identity_certificate_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'), + 'clusterName': self._serialize.url("cluster_name", cluster_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, 'UpdateClusterIdentityCertificateParameters') + 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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _update_identity_certificate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/updateClusterIdentityCertificate'} # type: ignore + + async def begin_update_identity_certificate( + self, + resource_group_name: str, + cluster_name: str, + parameters: "_models.UpdateClusterIdentityCertificateParameters", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Updates the cluster identity certificate. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param parameters: The cluster configurations. + :type parameters: ~azure.mgmt.hdinsight.models.UpdateClusterIdentityCertificateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: 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._update_identity_certificate_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_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): + if cls: + return cls(pipeline_response, None, {}) + + 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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if 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_identity_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/updateClusterIdentityCertificate'} # type: ignore + async def _execute_script_actions_initial( self, resource_group_name: str, cluster_name: str, parameters: "_models.ExecuteScriptActionParameters", - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -1131,9 +1313,9 @@ async def _execute_script_actions_initial( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 202, 404]: 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: @@ -1146,7 +1328,7 @@ async def begin_execute_script_actions( resource_group_name: str, cluster_name: str, parameters: "_models.ExecuteScriptActionParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Executes script actions on the specified HDInsight cluster. @@ -1158,8 +1340,8 @@ async def begin_execute_script_actions( :type parameters: ~azure.mgmt.hdinsight.models.ExecuteScriptActionParameters :keyword callable cls: A custom type or function 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: 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) @@ -1195,7 +1377,7 @@ def get_long_running_output(pipeline_response): 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_configurations_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_configurations_operations.py index 588f7d5d2c03..0dc8945c0800 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_configurations_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_configurations_operations.py @@ -46,7 +46,7 @@ async def list( self, resource_group_name: str, cluster_name: str, - **kwargs + **kwargs: Any ) -> "_models.ClusterConfigurations": """Gets all configuration information for an HDI cluster. @@ -90,7 +90,7 @@ async def list( 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('ClusterConfigurations', pipeline_response) @@ -107,7 +107,7 @@ async def _update_initial( cluster_name: str, configuration_name: str, parameters: Dict[str, str], - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -146,7 +146,7 @@ async def _update_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: @@ -160,7 +160,7 @@ async def begin_update( cluster_name: str, configuration_name: str, parameters: Dict[str, str], - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings in cluster endpoint instead. @@ -175,8 +175,8 @@ async def begin_update( :type parameters: dict[str, str] :keyword callable cls: A custom type or function 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: 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) @@ -214,7 +214,7 @@ def get_long_running_output(pipeline_response): 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -233,7 +233,7 @@ async def get( resource_group_name: str, cluster_name: str, configuration_name: str, - **kwargs + **kwargs: Any ) -> Dict[str, str]: """The configuration object for the specified cluster. This API is not recommended and might be removed in the future. Please consider using List configurations API instead. @@ -281,7 +281,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('{str}', pipeline_response) diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_extensions_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_extensions_operations.py index 986ee4ba4c73..432d182d5f0d 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_extensions_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_extensions_operations.py @@ -47,7 +47,7 @@ async def _enable_monitoring_initial( resource_group_name: str, cluster_name: str, parameters: "_models.ClusterMonitoringRequest", - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -85,7 +85,7 @@ async def _enable_monitoring_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) if cls: @@ -98,7 +98,7 @@ async def begin_enable_monitoring( resource_group_name: str, cluster_name: str, parameters: "_models.ClusterMonitoringRequest", - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Enables the Operations Management Suite (OMS) on the HDInsight cluster. @@ -110,8 +110,8 @@ async def begin_enable_monitoring( :type parameters: ~azure.mgmt.hdinsight.models.ClusterMonitoringRequest :keyword callable cls: A custom type or function 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: 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) @@ -147,7 +147,7 @@ def get_long_running_output(pipeline_response): 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -165,7 +165,7 @@ async def get_monitoring_status( self, resource_group_name: str, cluster_name: str, - **kwargs + **kwargs: Any ) -> "_models.ClusterMonitoringResponse": """Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. @@ -209,7 +209,7 @@ async def get_monitoring_status( 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('ClusterMonitoringResponse', pipeline_response) @@ -224,7 +224,7 @@ async def _disable_monitoring_initial( self, resource_group_name: str, cluster_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -255,9 +255,9 @@ async def _disable_monitoring_initial( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 202]: + 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: @@ -269,7 +269,7 @@ async def begin_disable_monitoring( self, resource_group_name: str, cluster_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Disables the Operations Management Suite (OMS) on the HDInsight cluster. @@ -279,8 +279,8 @@ async def begin_disable_monitoring( :type cluster_name: str :keyword callable cls: A custom type or function 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: 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) @@ -315,7 +315,7 @@ def get_long_running_output(pipeline_response): 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,13 +329,300 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_disable_monitoring.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring'} # type: ignore + async def _enable_azure_monitor_initial( + self, + resource_group_name: str, + cluster_name: str, + parameters: "_models.AzureMonitorRequest", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._enable_azure_monitor_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'), + 'clusterName': self._serialize.url("cluster_name", cluster_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, 'AzureMonitorRequest') + 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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _enable_azure_monitor_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitor'} # type: ignore + + async def begin_enable_azure_monitor( + self, + resource_group_name: str, + cluster_name: str, + parameters: "_models.AzureMonitorRequest", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Enables the Azure Monitor on the HDInsight cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param parameters: The Log Analytics workspace parameters. + :type parameters: ~azure.mgmt.hdinsight.models.AzureMonitorRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: 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._enable_azure_monitor_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_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): + if cls: + return cls(pipeline_response, None, {}) + + 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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if 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_enable_azure_monitor.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitor'} # type: ignore + + async def get_azure_monitor_status( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> "_models.AzureMonitorResponse": + """Gets the status of Azure Monitor on the HDInsight cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureMonitorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.hdinsight.models.AzureMonitorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureMonitorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_azure_monitor_status.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_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.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureMonitorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_azure_monitor_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitor'} # type: ignore + + async def _disable_azure_monitor_initial( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-01-preview" + accept = "application/json" + + # Construct URL + url = self._disable_azure_monitor_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'), + 'clusterName': self._serialize.url("cluster_name", cluster_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.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _disable_azure_monitor_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitor'} # type: ignore + + async def begin_disable_azure_monitor( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Disables the Azure Monitor on the HDInsight cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: 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._disable_azure_monitor_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_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, {}) + + 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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if 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_disable_azure_monitor.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitor'} # type: ignore + async def _create_initial( self, resource_group_name: str, cluster_name: str, extension_name: str, parameters: "_models.Extension", - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -374,7 +661,7 @@ async def _create_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) if cls: @@ -388,7 +675,7 @@ async def begin_create( cluster_name: str, extension_name: str, parameters: "_models.Extension", - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Creates an HDInsight cluster extension. @@ -402,8 +689,8 @@ async def begin_create( :type parameters: ~azure.mgmt.hdinsight.models.Extension :keyword callable cls: A custom type or function 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: 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) @@ -441,7 +728,7 @@ def get_long_running_output(pipeline_response): 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -460,8 +747,8 @@ async def get( resource_group_name: str, cluster_name: str, extension_name: str, - **kwargs - ) -> "_models.Extension": + **kwargs: Any + ) -> "_models.ClusterMonitoringResponse": """Gets the extension properties for the specified HDInsight cluster extension. :param resource_group_name: The name of the resource group. @@ -471,11 +758,11 @@ async def get( :param extension_name: The name of the cluster extension. :type extension_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Extension, or the result of cls(response) - :rtype: ~azure.mgmt.hdinsight.models.Extension + :return: ClusterMonitoringResponse, or the result of cls(response) + :rtype: ~azure.mgmt.hdinsight.models.ClusterMonitoringResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterMonitoringResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -507,10 +794,10 @@ 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('Extension', pipeline_response) + deserialized = self._deserialize('ClusterMonitoringResponse', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -523,7 +810,7 @@ async def _delete_initial( resource_group_name: str, cluster_name: str, extension_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -555,9 +842,9 @@ async def _delete_initial( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 202]: + 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: @@ -570,7 +857,7 @@ async def begin_delete( resource_group_name: str, cluster_name: str, extension_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes the specified extension for HDInsight cluster. @@ -582,8 +869,8 @@ async def begin_delete( :type extension_name: str :keyword callable cls: A custom type or function 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: 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) @@ -620,7 +907,7 @@ def get_long_running_output(pipeline_response): 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -633,3 +920,70 @@ def get_long_running_output(pipeline_response): else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}'} # type: ignore + + async def get_azure_async_operation_status( + self, + resource_group_name: str, + cluster_name: str, + extension_name: str, + operation_id: str, + **kwargs: Any + ) -> "_models.AsyncOperationResult": + """Gets the async operation status. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param extension_name: The name of the cluster extension. + :type extension_name: str + :param operation_id: The long running operation id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AsyncOperationResult, or the result of cls(response) + :rtype: ~azure.mgmt.hdinsight.models.AsyncOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AsyncOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_azure_async_operation_status.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_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['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.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AsyncOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_azure_async_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}/azureAsyncOperations/{operationId}'} # type: ignore diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_locations_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_locations_operations.py index adbb213657ea..66cec3afe434 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_locations_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_locations_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get_capabilities( self, location: str, - **kwargs + **kwargs: Any ) -> "_models.CapabilitiesResult": """Gets the capabilities for the specified location. @@ -84,7 +84,7 @@ async def get_capabilities( 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('CapabilitiesResult', pipeline_response) @@ -98,7 +98,7 @@ async def get_capabilities( async def list_usages( self, location: str, - **kwargs + **kwargs: Any ) -> "_models.UsagesListResult": """Lists the usages for the specified location. @@ -139,7 +139,7 @@ async def list_usages( 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('UsagesListResult', pipeline_response) @@ -153,7 +153,7 @@ async def list_usages( async def list_billing_specs( self, location: str, - **kwargs + **kwargs: Any ) -> "_models.BillingResponseListResult": """Lists the billingSpecs for the specified subscription and location. @@ -194,7 +194,7 @@ async def list_billing_specs( 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('BillingResponseListResult', pipeline_response) @@ -204,3 +204,188 @@ async def list_billing_specs( return deserialized list_billing_specs.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/billingSpecs'} # type: ignore + + async def get_azure_async_operation_status( + self, + location: str, + operation_id: str, + **kwargs: Any + ) -> "_models.AsyncOperationResult": + """Get the async operation status. + + :param location: The Azure location (region) for which to make the request. + :type location: str + :param operation_id: The long running operation id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AsyncOperationResult, or the result of cls(response) + :rtype: ~azure.mgmt.hdinsight.models.AsyncOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AsyncOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_azure_async_operation_status.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'), + 'operationId': self._serialize.url("operation_id", operation_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['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.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AsyncOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_azure_async_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/azureasyncoperations/{operationId}'} # type: ignore + + async def check_name_availability( + self, + location: str, + parameters: "_models.NameAvailabilityCheckRequestParameters", + **kwargs: Any + ) -> "_models.NameAvailabilityCheckResult": + """Check the cluster name is available or not. + + :param location: The Azure location (region) for which to make the request. + :type location: str + :param parameters: + :type parameters: ~azure.mgmt.hdinsight.models.NameAvailabilityCheckRequestParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NameAvailabilityCheckResult, or the result of cls(response) + :rtype: ~azure.mgmt.hdinsight.models.NameAvailabilityCheckResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NameAvailabilityCheckResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.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'), + } + 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, 'NameAvailabilityCheckRequestParameters') + 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.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NameAvailabilityCheckResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/checkNameAvailability'} # type: ignore + + async def validate_cluster_create_request( + self, + location: str, + parameters: "_models.ClusterCreateRequestValidationParameters", + **kwargs: Any + ) -> "_models.ClusterCreateValidationResult": + """Validate the cluster create request spec is valid or not. + + :param location: The Azure location (region) for which to make the request. + :type location: str + :param parameters: + :type parameters: ~azure.mgmt.hdinsight.models.ClusterCreateRequestValidationParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ClusterCreateValidationResult, or the result of cls(response) + :rtype: ~azure.mgmt.hdinsight.models.ClusterCreateValidationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterCreateValidationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_cluster_create_request.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'), + } + 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, 'ClusterCreateRequestValidationParameters') + 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.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ClusterCreateValidationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate_cluster_create_request.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/validateCreateRequest'} # type: ignore diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_operations.py index 957801b6f902..348d8ce57466 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available HDInsight REST API operations. @@ -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/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_script_actions_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_script_actions_operations.py index 00d6307f4927..84ac2c377d84 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_script_actions_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_script_actions_operations.py @@ -46,7 +46,7 @@ async def delete( resource_group_name: str, cluster_name: str, script_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a specified persisted script action of the cluster. @@ -91,9 +91,9 @@ async def delete( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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) if cls: @@ -105,7 +105,7 @@ def list_by_cluster( self, resource_group_name: str, cluster_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ScriptActionsList"]: """Lists all the persisted script actions for the specified cluster. @@ -165,7 +165,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) @@ -181,7 +181,7 @@ async def get_execution_detail( resource_group_name: str, cluster_name: str, script_execution_id: str, - **kwargs + **kwargs: Any ) -> "_models.RuntimeScriptActionDetail": """Gets the script execution detail for the given script execution ID. @@ -228,7 +228,7 @@ async def get_execution_detail( 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('RuntimeScriptActionDetail', pipeline_response) @@ -238,3 +238,66 @@ async def get_execution_detail( return deserialized get_execution_detail.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}'} # type: ignore + + async def get_execution_async_operation_status( + self, + resource_group_name: str, + cluster_name: str, + operation_id: str, + **kwargs: Any + ) -> "_models.AsyncOperationResult": + """Gets the async operation status of execution operation. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param operation_id: The long running operation id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AsyncOperationResult, or the result of cls(response) + :rtype: ~azure.mgmt.hdinsight.models.AsyncOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AsyncOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_execution_async_operation_status.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_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['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.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AsyncOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_execution_async_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/executeScriptActions/azureasyncoperations/{operationId}'} # type: ignore diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_script_execution_history_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_script_execution_history_operations.py index 3a8bfb919900..d60f0b77bbda 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_script_execution_history_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_script_execution_history_operations.py @@ -45,7 +45,7 @@ def list_by_cluster( self, resource_group_name: str, cluster_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ScriptActionExecutionHistoryList"]: """Lists all scripts' execution history for the specified cluster. @@ -105,7 +105,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) @@ -121,7 +121,7 @@ async def promote( resource_group_name: str, cluster_name: str, script_execution_id: str, - **kwargs + **kwargs: Any ) -> None: """Promotes the specified ad-hoc script execution to a persisted script. @@ -168,7 +168,7 @@ async def promote( 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) if cls: diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_virtual_machines_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_virtual_machines_operations.py index d8bb8a88c13d..3bbca57c71c3 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_virtual_machines_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/aio/operations/_virtual_machines_operations.py @@ -46,7 +46,7 @@ async def list_hosts( self, resource_group_name: str, cluster_name: str, - **kwargs + **kwargs: Any ) -> List["_models.HostInfo"]: """Lists the HDInsight clusters hosts. @@ -90,7 +90,7 @@ async def list_hosts( 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('[HostInfo]', pipeline_response) @@ -106,7 +106,7 @@ async def _restart_hosts_initial( resource_group_name: str, cluster_name: str, hosts: List[str], - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -144,7 +144,7 @@ async def _restart_hosts_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) if cls: @@ -157,7 +157,7 @@ async def begin_restart_hosts( resource_group_name: str, cluster_name: str, hosts: List[str], - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Restarts the specified HDInsight cluster hosts. @@ -169,8 +169,8 @@ async def begin_restart_hosts( :type hosts: list[str] :keyword callable cls: A custom type or function 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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: 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) @@ -206,7 +206,7 @@ def get_long_running_output(pipeline_response): 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -219,3 +219,66 @@ def get_long_running_output(pipeline_response): else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_restart_hosts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/restartHosts'} # type: ignore + + async def get_async_operation_status( + self, + resource_group_name: str, + cluster_name: str, + operation_id: str, + **kwargs: Any + ) -> "_models.AsyncOperationResult": + """Gets the async operation status. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param operation_id: The long running operation id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AsyncOperationResult, or the result of cls(response) + :rtype: ~azure.mgmt.hdinsight.models.AsyncOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AsyncOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_async_operation_status.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_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['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.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AsyncOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_async_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/restartHosts/azureasyncoperations/{operationId}'} # type: ignore diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/__init__.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/__init__.py index 45c8225bd23e..9ed0a5bd064a 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/__init__.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/__init__.py @@ -7,17 +7,23 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import AaddsResourceDetails from ._models_py3 import Application from ._models_py3 import ApplicationGetEndpoint from ._models_py3 import ApplicationGetHttpsEndpoint from ._models_py3 import ApplicationListResult from ._models_py3 import ApplicationProperties + from ._models_py3 import AsyncOperationResult from ._models_py3 import Autoscale from ._models_py3 import AutoscaleCapacity from ._models_py3 import AutoscaleConfigurationUpdateParameter from ._models_py3 import AutoscaleRecurrence from ._models_py3 import AutoscaleSchedule from ._models_py3 import AutoscaleTimeAndCapacity + from ._models_py3 import AzureMonitorRequest + from ._models_py3 import AzureMonitorResponse + from ._models_py3 import AzureMonitorSelectedConfigurations + from ._models_py3 import AzureMonitorTableConfiguration from ._models_py3 import BillingMeters from ._models_py3 import BillingResources from ._models_py3 import BillingResponseListResult @@ -27,6 +33,8 @@ from ._models_py3 import ClusterConfigurations from ._models_py3 import ClusterCreateParametersExtended from ._models_py3 import ClusterCreateProperties + from ._models_py3 import ClusterCreateRequestValidationParameters + from ._models_py3 import ClusterCreateValidationResult from ._models_py3 import ClusterDefinition from ._models_py3 import ClusterDiskEncryptionParameters from ._models_py3 import ClusterGetProperties @@ -44,11 +52,13 @@ from ._models_py3 import ComputeProfile from ._models_py3 import ConnectivityEndpoint from ._models_py3 import DataDisksGroups + from ._models_py3 import Dimension from ._models_py3 import DiskBillingMeters from ._models_py3 import DiskEncryptionProperties from ._models_py3 import EncryptionInTransitProperties from ._models_py3 import ErrorResponse from ._models_py3 import Errors + from ._models_py3 import ExcludedServicesConfig from ._models_py3 import ExecuteScriptActionParameters from ._models_py3 import Extension from ._models_py3 import GatewaySettings @@ -57,11 +67,14 @@ from ._models_py3 import KafkaRestProperties from ._models_py3 import LinuxOperatingSystemProfile from ._models_py3 import LocalizedName + from ._models_py3 import MetricSpecifications + from ._models_py3 import NameAvailabilityCheckRequestParameters + from ._models_py3 import NameAvailabilityCheckResult from ._models_py3 import NetworkProperties from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationListResult - from ._models_py3 import OperationResource + from ._models_py3 import OperationProperties from ._models_py3 import OsProfile from ._models_py3 import ProxyResource from ._models_py3 import QuotaCapability @@ -78,32 +91,42 @@ from ._models_py3 import ScriptActionPersistedGetResponseSpec from ._models_py3 import ScriptActionsList from ._models_py3 import SecurityProfile + from ._models_py3 import ServiceSpecification from ._models_py3 import SshProfile from ._models_py3 import SshPublicKey from ._models_py3 import StorageAccount from ._models_py3 import StorageProfile from ._models_py3 import TrackedResource + from ._models_py3 import UpdateClusterIdentityCertificateParameters from ._models_py3 import UpdateGatewaySettingsParameters from ._models_py3 import Usage from ._models_py3 import UsagesListResult + from ._models_py3 import ValidationErrorInfo from ._models_py3 import VersionSpec from ._models_py3 import VersionsCapability from ._models_py3 import VirtualNetworkProfile from ._models_py3 import VmSizeCompatibilityFilter from ._models_py3 import VmSizeCompatibilityFilterV2 + from ._models_py3 import VmSizeProperty from ._models_py3 import VmSizesCapability except (SyntaxError, ImportError): + from ._models import AaddsResourceDetails # type: ignore from ._models import Application # type: ignore from ._models import ApplicationGetEndpoint # type: ignore from ._models import ApplicationGetHttpsEndpoint # type: ignore from ._models import ApplicationListResult # type: ignore from ._models import ApplicationProperties # type: ignore + from ._models import AsyncOperationResult # type: ignore from ._models import Autoscale # type: ignore from ._models import AutoscaleCapacity # type: ignore from ._models import AutoscaleConfigurationUpdateParameter # type: ignore from ._models import AutoscaleRecurrence # type: ignore from ._models import AutoscaleSchedule # type: ignore from ._models import AutoscaleTimeAndCapacity # type: ignore + from ._models import AzureMonitorRequest # type: ignore + from ._models import AzureMonitorResponse # type: ignore + from ._models import AzureMonitorSelectedConfigurations # type: ignore + from ._models import AzureMonitorTableConfiguration # type: ignore from ._models import BillingMeters # type: ignore from ._models import BillingResources # type: ignore from ._models import BillingResponseListResult # type: ignore @@ -113,6 +136,8 @@ from ._models import ClusterConfigurations # type: ignore from ._models import ClusterCreateParametersExtended # type: ignore from ._models import ClusterCreateProperties # type: ignore + from ._models import ClusterCreateRequestValidationParameters # type: ignore + from ._models import ClusterCreateValidationResult # type: ignore from ._models import ClusterDefinition # type: ignore from ._models import ClusterDiskEncryptionParameters # type: ignore from ._models import ClusterGetProperties # type: ignore @@ -130,11 +155,13 @@ from ._models import ComputeProfile # type: ignore from ._models import ConnectivityEndpoint # type: ignore from ._models import DataDisksGroups # type: ignore + from ._models import Dimension # type: ignore from ._models import DiskBillingMeters # type: ignore from ._models import DiskEncryptionProperties # type: ignore from ._models import EncryptionInTransitProperties # type: ignore from ._models import ErrorResponse # type: ignore from ._models import Errors # type: ignore + from ._models import ExcludedServicesConfig # type: ignore from ._models import ExecuteScriptActionParameters # type: ignore from ._models import Extension # type: ignore from ._models import GatewaySettings # type: ignore @@ -143,11 +170,14 @@ from ._models import KafkaRestProperties # type: ignore from ._models import LinuxOperatingSystemProfile # type: ignore from ._models import LocalizedName # type: ignore + from ._models import MetricSpecifications # type: ignore + from ._models import NameAvailabilityCheckRequestParameters # type: ignore + from ._models import NameAvailabilityCheckResult # type: ignore from ._models import NetworkProperties # type: ignore from ._models import Operation # type: ignore from ._models import OperationDisplay # type: ignore from ._models import OperationListResult # type: ignore - from ._models import OperationResource # type: ignore + from ._models import OperationProperties # type: ignore from ._models import OsProfile # type: ignore from ._models import ProxyResource # type: ignore from ._models import QuotaCapability # type: ignore @@ -164,19 +194,23 @@ from ._models import ScriptActionPersistedGetResponseSpec # type: ignore from ._models import ScriptActionsList # type: ignore from ._models import SecurityProfile # type: ignore + from ._models import ServiceSpecification # type: ignore from ._models import SshProfile # type: ignore from ._models import SshPublicKey # type: ignore from ._models import StorageAccount # type: ignore from ._models import StorageProfile # type: ignore from ._models import TrackedResource # type: ignore + from ._models import UpdateClusterIdentityCertificateParameters # type: ignore from ._models import UpdateGatewaySettingsParameters # type: ignore from ._models import Usage # type: ignore from ._models import UsagesListResult # type: ignore + from ._models import ValidationErrorInfo # type: ignore from ._models import VersionSpec # type: ignore from ._models import VersionsCapability # type: ignore from ._models import VirtualNetworkProfile # type: ignore from ._models import VmSizeCompatibilityFilter # type: ignore from ._models import VmSizeCompatibilityFilterV2 # type: ignore + from ._models import VmSizeProperty # type: ignore from ._models import VmSizesCapability # type: ignore from ._hd_insight_management_client_enums import ( @@ -194,17 +228,23 @@ ) __all__ = [ + 'AaddsResourceDetails', 'Application', 'ApplicationGetEndpoint', 'ApplicationGetHttpsEndpoint', 'ApplicationListResult', 'ApplicationProperties', + 'AsyncOperationResult', 'Autoscale', 'AutoscaleCapacity', 'AutoscaleConfigurationUpdateParameter', 'AutoscaleRecurrence', 'AutoscaleSchedule', 'AutoscaleTimeAndCapacity', + 'AzureMonitorRequest', + 'AzureMonitorResponse', + 'AzureMonitorSelectedConfigurations', + 'AzureMonitorTableConfiguration', 'BillingMeters', 'BillingResources', 'BillingResponseListResult', @@ -214,6 +254,8 @@ 'ClusterConfigurations', 'ClusterCreateParametersExtended', 'ClusterCreateProperties', + 'ClusterCreateRequestValidationParameters', + 'ClusterCreateValidationResult', 'ClusterDefinition', 'ClusterDiskEncryptionParameters', 'ClusterGetProperties', @@ -231,11 +273,13 @@ 'ComputeProfile', 'ConnectivityEndpoint', 'DataDisksGroups', + 'Dimension', 'DiskBillingMeters', 'DiskEncryptionProperties', 'EncryptionInTransitProperties', 'ErrorResponse', 'Errors', + 'ExcludedServicesConfig', 'ExecuteScriptActionParameters', 'Extension', 'GatewaySettings', @@ -244,11 +288,14 @@ 'KafkaRestProperties', 'LinuxOperatingSystemProfile', 'LocalizedName', + 'MetricSpecifications', + 'NameAvailabilityCheckRequestParameters', + 'NameAvailabilityCheckResult', 'NetworkProperties', 'Operation', 'OperationDisplay', 'OperationListResult', - 'OperationResource', + 'OperationProperties', 'OsProfile', 'ProxyResource', 'QuotaCapability', @@ -265,19 +312,23 @@ 'ScriptActionPersistedGetResponseSpec', 'ScriptActionsList', 'SecurityProfile', + 'ServiceSpecification', 'SshProfile', 'SshPublicKey', 'StorageAccount', 'StorageProfile', 'TrackedResource', + 'UpdateClusterIdentityCertificateParameters', 'UpdateGatewaySettingsParameters', 'Usage', 'UsagesListResult', + 'ValidationErrorInfo', 'VersionSpec', 'VersionsCapability', 'VirtualNetworkProfile', 'VmSizeCompatibilityFilter', 'VmSizeCompatibilityFilterV2', + 'VmSizeProperty', 'VmSizesCapability', 'AsyncOperationState', 'DaysOfWeek', diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_hd_insight_management_client_enums.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_hd_insight_management_client_enums.py index 125a8e1ae3ca..08b7cb9dc184 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_hd_insight_management_client_enums.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_hd_insight_management_client_enums.py @@ -51,6 +51,8 @@ class FilterMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): EXCLUDE = "Exclude" INCLUDE = "Include" + RECOMMEND = "Recommend" + DEFAULT = "Default" class HDInsightClusterProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state, which only appears in the response. diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models.py index 8b219edd1594..7f3faeb12bd2 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models.py @@ -10,6 +10,50 @@ import msrest.serialization +class AaddsResourceDetails(msrest.serialization.Model): + """The Azure active directory domain service resource details. + + :param domain_name: The Azure active directory domain service name. + :type domain_name: str + :param initial_sync_complete: This indicates whether initial sync complete or not. + :type initial_sync_complete: bool + :param ldaps_enabled: This indicates whether enable ldaps or not. + :type ldaps_enabled: bool + :param ldaps_public_certificate_in_base64: The base 64 format string of public ldap + certificate. + :type ldaps_public_certificate_in_base64: str + :param resource_id: The resource id of azure active directory domain service. + :type resource_id: str + :param subnet_id: The subnet resource id. + :type subnet_id: str + :param tenant_id: The tenant id of azure active directory domain service . + :type tenant_id: str + """ + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'initial_sync_complete': {'key': 'initialSyncComplete', 'type': 'bool'}, + 'ldaps_enabled': {'key': 'ldapsEnabled', 'type': 'bool'}, + 'ldaps_public_certificate_in_base64': {'key': 'ldapsPublicCertificateInBase64', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'subnet_id': {'key': 'subnetId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AaddsResourceDetails, self).__init__(**kwargs) + self.domain_name = kwargs.get('domain_name', None) + self.initial_sync_complete = kwargs.get('initial_sync_complete', None) + self.ldaps_enabled = kwargs.get('ldaps_enabled', None) + self.ldaps_public_certificate_in_base64 = kwargs.get('ldaps_public_certificate_in_base64', None) + self.resource_id = kwargs.get('resource_id', None) + self.subnet_id = kwargs.get('subnet_id', None) + self.tenant_id = kwargs.get('tenant_id', None) + + class Resource(msrest.serialization.Model): """The core properties of ARM resources. @@ -45,7 +89,39 @@ def __init__( self.type = None -class Application(Resource): +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class Application(ProxyResource): """The HDInsight cluster application. Variables are only populated by the server, and will be ignored when sending a request. @@ -98,12 +174,15 @@ class ApplicationGetEndpoint(msrest.serialization.Model): :type destination_port: int :param public_port: The public port to connect to. :type public_port: int + :param private_ip_address: The private ip address of the endpoint. + :type private_ip_address: str """ _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'destination_port': {'key': 'destinationPort', 'type': 'int'}, 'public_port': {'key': 'publicPort', 'type': 'int'}, + 'private_ip_address': {'key': 'privateIPAddress', 'type': 'str'}, } def __init__( @@ -114,30 +193,41 @@ def __init__( self.location = kwargs.get('location', None) self.destination_port = kwargs.get('destination_port', None) self.public_port = kwargs.get('public_port', None) + self.private_ip_address = kwargs.get('private_ip_address', None) class ApplicationGetHttpsEndpoint(msrest.serialization.Model): """Gets the application HTTP endpoints. + Variables are only populated by the server, and will be ignored when sending a request. + :param access_modes: The list of access modes for the application. :type access_modes: list[str] - :param location: The location of the endpoint. - :type location: str + :ivar location: The location of the endpoint. + :vartype location: str :param destination_port: The destination port to connect to. :type destination_port: int - :param public_port: The public port to connect to. - :type public_port: int + :ivar public_port: The public port to connect to. + :vartype public_port: int + :param private_ip_address: The private ip address of the endpoint. + :type private_ip_address: str :param sub_domain_suffix: The subdomain suffix of the application. :type sub_domain_suffix: str :param disable_gateway_auth: The value indicates whether to disable GatewayAuth. :type disable_gateway_auth: bool """ + _validation = { + 'location': {'readonly': True}, + 'public_port': {'readonly': True}, + } + _attribute_map = { 'access_modes': {'key': 'accessModes', 'type': '[str]'}, 'location': {'key': 'location', 'type': 'str'}, 'destination_port': {'key': 'destinationPort', 'type': 'int'}, 'public_port': {'key': 'publicPort', 'type': 'int'}, + 'private_ip_address': {'key': 'privateIPAddress', 'type': 'str'}, 'sub_domain_suffix': {'key': 'subDomainSuffix', 'type': 'str'}, 'disable_gateway_auth': {'key': 'disableGatewayAuth', 'type': 'bool'}, } @@ -148,9 +238,10 @@ def __init__( ): super(ApplicationGetHttpsEndpoint, self).__init__(**kwargs) self.access_modes = kwargs.get('access_modes', None) - self.location = kwargs.get('location', None) + self.location = None self.destination_port = kwargs.get('destination_port', None) - self.public_port = kwargs.get('public_port', None) + self.public_port = None + self.private_ip_address = kwargs.get('private_ip_address', None) self.sub_domain_suffix = kwargs.get('sub_domain_suffix', None) self.disable_gateway_auth = kwargs.get('disable_gateway_auth', None) @@ -252,6 +343,30 @@ def __init__( self.marketplace_identifier = None +class AsyncOperationResult(msrest.serialization.Model): + """The azure async operation response. + + :param status: The async operation state. Possible values include: "InProgress", "Succeeded", + "Failed". + :type status: str or ~azure.mgmt.hdinsight.models.AsyncOperationState + :param error: The operation error information. + :type error: ~azure.mgmt.hdinsight.models.Errors + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Errors'}, + } + + def __init__( + self, + **kwargs + ): + super(AsyncOperationResult, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) + + class Autoscale(msrest.serialization.Model): """The autoscale request parameters. @@ -390,6 +505,106 @@ def __init__( self.max_instance_count = kwargs.get('max_instance_count', None) +class AzureMonitorRequest(msrest.serialization.Model): + """The azure monitor parameters. + + :param workspace_id: The Log Analytics workspace ID. + :type workspace_id: str + :param primary_key: The Log Analytics workspace key. + :type primary_key: str + :param selected_configurations: The selected configurations. + :type selected_configurations: ~azure.mgmt.hdinsight.models.AzureMonitorSelectedConfigurations + """ + + _attribute_map = { + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'selected_configurations': {'key': 'selectedConfigurations', 'type': 'AzureMonitorSelectedConfigurations'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureMonitorRequest, self).__init__(**kwargs) + self.workspace_id = kwargs.get('workspace_id', None) + self.primary_key = kwargs.get('primary_key', None) + self.selected_configurations = kwargs.get('selected_configurations', None) + + +class AzureMonitorResponse(msrest.serialization.Model): + """The azure monitor status response. + + :param cluster_monitoring_enabled: The status of the monitor on the HDInsight cluster. + :type cluster_monitoring_enabled: bool + :param workspace_id: The workspace ID of the monitor on the HDInsight cluster. + :type workspace_id: str + :param selected_configurations: The selected configurations. + :type selected_configurations: ~azure.mgmt.hdinsight.models.AzureMonitorSelectedConfigurations + """ + + _attribute_map = { + 'cluster_monitoring_enabled': {'key': 'clusterMonitoringEnabled', 'type': 'bool'}, + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + 'selected_configurations': {'key': 'selectedConfigurations', 'type': 'AzureMonitorSelectedConfigurations'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureMonitorResponse, self).__init__(**kwargs) + self.cluster_monitoring_enabled = kwargs.get('cluster_monitoring_enabled', None) + self.workspace_id = kwargs.get('workspace_id', None) + self.selected_configurations = kwargs.get('selected_configurations', None) + + +class AzureMonitorSelectedConfigurations(msrest.serialization.Model): + """The selected configurations for azure monitor. + + :param configuration_version: The configuration version. + :type configuration_version: str + :param global_configurations: The global configurations of selected configurations. + :type global_configurations: dict[str, str] + :param table_list: The table list. + :type table_list: list[~azure.mgmt.hdinsight.models.AzureMonitorTableConfiguration] + """ + + _attribute_map = { + 'configuration_version': {'key': 'configurationVersion', 'type': 'str'}, + 'global_configurations': {'key': 'globalConfigurations', 'type': '{str}'}, + 'table_list': {'key': 'tableList', 'type': '[AzureMonitorTableConfiguration]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureMonitorSelectedConfigurations, self).__init__(**kwargs) + self.configuration_version = kwargs.get('configuration_version', None) + self.global_configurations = kwargs.get('global_configurations', None) + self.table_list = kwargs.get('table_list', None) + + +class AzureMonitorTableConfiguration(msrest.serialization.Model): + """The table configuration for the Log Analytics integration. + + :param name: The name. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureMonitorTableConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + class BillingMeters(msrest.serialization.Model): """The billing meters. @@ -447,18 +662,30 @@ def __init__( class BillingResponseListResult(msrest.serialization.Model): """The response for the operation to get regional billingSpecs for a subscription. + Variables are only populated by the server, and will be ignored when sending a request. + :param vm_sizes: The virtual machine sizes to include or exclude. :type vm_sizes: list[str] + :param vm_sizes_with_encryption_at_host: The vm sizes which enable encryption at host. + :type vm_sizes_with_encryption_at_host: list[str] :param vm_size_filters: The virtual machine filtering mode. Effectively this can enabling or disabling the virtual machine sizes in a particular set. :type vm_size_filters: list[~azure.mgmt.hdinsight.models.VmSizeCompatibilityFilterV2] + :ivar vm_size_properties: The vm size properties. + :vartype vm_size_properties: list[~azure.mgmt.hdinsight.models.VmSizeProperty] :param billing_resources: The billing and managed disk billing resources for a region. :type billing_resources: list[~azure.mgmt.hdinsight.models.BillingResources] """ + _validation = { + 'vm_size_properties': {'readonly': True}, + } + _attribute_map = { 'vm_sizes': {'key': 'vmSizes', 'type': '[str]'}, + 'vm_sizes_with_encryption_at_host': {'key': 'vmSizesWithEncryptionAtHost', 'type': '[str]'}, 'vm_size_filters': {'key': 'vmSizeFilters', 'type': '[VmSizeCompatibilityFilterV2]'}, + 'vm_size_properties': {'key': 'vmSizeProperties', 'type': '[VmSizeProperty]'}, 'billing_resources': {'key': 'billingResources', 'type': '[BillingResources]'}, } @@ -468,7 +695,9 @@ def __init__( ): super(BillingResponseListResult, self).__init__(**kwargs) self.vm_sizes = kwargs.get('vm_sizes', None) + self.vm_sizes_with_encryption_at_host = kwargs.get('vm_sizes_with_encryption_at_host', None) self.vm_size_filters = kwargs.get('vm_size_filters', None) + self.vm_size_properties = None self.billing_resources = kwargs.get('billing_resources', None) @@ -481,10 +710,10 @@ class CapabilitiesResult(msrest.serialization.Model): :type versions: dict[str, ~azure.mgmt.hdinsight.models.VersionsCapability] :param regions: The virtual machine size compatibility features. :type regions: dict[str, ~azure.mgmt.hdinsight.models.RegionsCapability] - :param vm_sizes: The virtual machine sizes. - :type vm_sizes: dict[str, ~azure.mgmt.hdinsight.models.VmSizesCapability] - :param vm_size_filters: The virtual machine size compatibility filters. - :type vm_size_filters: list[~azure.mgmt.hdinsight.models.VmSizeCompatibilityFilter] + :param vmsizes: The virtual machine sizes. + :type vmsizes: dict[str, ~azure.mgmt.hdinsight.models.VmSizesCapability] + :param vmsize_filters: The virtual machine size compatibility filters. + :type vmsize_filters: list[~azure.mgmt.hdinsight.models.VmSizeCompatibilityFilter] :param features: The capability features. :type features: list[str] :ivar quota: The quota capability. @@ -498,8 +727,8 @@ class CapabilitiesResult(msrest.serialization.Model): _attribute_map = { 'versions': {'key': 'versions', 'type': '{VersionsCapability}'}, 'regions': {'key': 'regions', 'type': '{RegionsCapability}'}, - 'vm_sizes': {'key': 'vmSizes', 'type': '{VmSizesCapability}'}, - 'vm_size_filters': {'key': 'vmSize_filters', 'type': '[VmSizeCompatibilityFilter]'}, + 'vmsizes': {'key': 'vmsizes', 'type': '{VmSizesCapability}'}, + 'vmsize_filters': {'key': 'vmsize_filters', 'type': '[VmSizeCompatibilityFilter]'}, 'features': {'key': 'features', 'type': '[str]'}, 'quota': {'key': 'quota', 'type': 'QuotaCapability'}, } @@ -511,8 +740,8 @@ def __init__( super(CapabilitiesResult, self).__init__(**kwargs) self.versions = kwargs.get('versions', None) self.regions = kwargs.get('regions', None) - self.vm_sizes = kwargs.get('vm_sizes', None) - self.vm_size_filters = kwargs.get('vm_size_filters', None) + self.vmsizes = kwargs.get('vmsizes', None) + self.vmsize_filters = kwargs.get('vmsize_filters', None) self.features = kwargs.get('features', None) self.quota = None @@ -749,6 +978,80 @@ def __init__( self.compute_isolation_properties = kwargs.get('compute_isolation_properties', None) +class ClusterCreateRequestValidationParameters(ClusterCreateParametersExtended): + """The cluster create request specification. + + :param location: The location of the cluster. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param properties: The cluster create parameters. + :type properties: ~azure.mgmt.hdinsight.models.ClusterCreateProperties + :param identity: The identity of the cluster, if configured. + :type identity: ~azure.mgmt.hdinsight.models.ClusterIdentity + :param name: The cluster name. + :type name: str + :param type: The resource type. + :type type: str + :param tenant_id: The tenant id. + :type tenant_id: str + :param fetch_aadds_resource: This indicates whether fetch Aadds resource or not. + :type fetch_aadds_resource: bool + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'ClusterCreateProperties'}, + 'identity': {'key': 'identity', 'type': 'ClusterIdentity'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'fetch_aadds_resource': {'key': 'fetchAaddsResource', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ClusterCreateRequestValidationParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.fetch_aadds_resource = kwargs.get('fetch_aadds_resource', None) + + +class ClusterCreateValidationResult(msrest.serialization.Model): + """The response of cluster create request validation. + + :param validation_errors: The validation errors. + :type validation_errors: list[~azure.mgmt.hdinsight.models.ValidationErrorInfo] + :param validation_warnings: The validation warnings. + :type validation_warnings: list[~azure.mgmt.hdinsight.models.ValidationErrorInfo] + :param estimated_creation_duration: The estimated creation duration. + :type estimated_creation_duration: ~datetime.timedelta + :param aadds_resources_details: The Azure active directory domain service resource details. + :type aadds_resources_details: list[~azure.mgmt.hdinsight.models.AaddsResourceDetails] + """ + + _attribute_map = { + 'validation_errors': {'key': 'validationErrors', 'type': '[ValidationErrorInfo]'}, + 'validation_warnings': {'key': 'validationWarnings', 'type': '[ValidationErrorInfo]'}, + 'estimated_creation_duration': {'key': 'estimatedCreationDuration', 'type': 'duration'}, + 'aadds_resources_details': {'key': 'aaddsResourcesDetails', 'type': '[AaddsResourceDetails]'}, + } + + def __init__( + self, + **kwargs + ): + super(ClusterCreateValidationResult, self).__init__(**kwargs) + self.validation_errors = kwargs.get('validation_errors', None) + self.validation_warnings = kwargs.get('validation_warnings', None) + self.estimated_creation_duration = kwargs.get('estimated_creation_duration', None) + self.aadds_resources_details = kwargs.get('aadds_resources_details', None) + + class ClusterDefinition(msrest.serialization.Model): """The cluster definition. @@ -759,7 +1062,7 @@ class ClusterDefinition(msrest.serialization.Model): :param component_version: The versions of different services in the cluster. :type component_version: dict[str, str] :param configurations: The cluster configurations. - :type configurations: object + :type configurations: any """ _attribute_map = { @@ -815,6 +1118,8 @@ class ClusterGetProperties(msrest.serialization.Model): :param cluster_version: The version of the cluster. :type cluster_version: str + :param cluster_hdp_version: The hdp version of the cluster. + :type cluster_hdp_version: str :param os_type: The type of operating system. Possible values include: "Windows", "Linux". :type os_type: str or ~azure.mgmt.hdinsight.models.OSType :param tier: The cluster tier. Possible values include: "Standard", "Premium". @@ -847,8 +1152,12 @@ class ClusterGetProperties(msrest.serialization.Model): :param encryption_in_transit_properties: The encryption-in-transit properties. :type encryption_in_transit_properties: ~azure.mgmt.hdinsight.models.EncryptionInTransitProperties + :param storage_profile: The storage profile. + :type storage_profile: ~azure.mgmt.hdinsight.models.StorageProfile :param min_supported_tls_version: The minimal supported tls version. :type min_supported_tls_version: str + :param excluded_services_config: The excluded services config. + :type excluded_services_config: ~azure.mgmt.hdinsight.models.ExcludedServicesConfig :param network_properties: The network properties. :type network_properties: ~azure.mgmt.hdinsight.models.NetworkProperties :param compute_isolation_properties: The compute isolation properties. @@ -861,6 +1170,7 @@ class ClusterGetProperties(msrest.serialization.Model): _attribute_map = { 'cluster_version': {'key': 'clusterVersion', 'type': 'str'}, + 'cluster_hdp_version': {'key': 'clusterHdpVersion', 'type': 'str'}, 'os_type': {'key': 'osType', 'type': 'str'}, 'tier': {'key': 'tier', 'type': 'str'}, 'cluster_id': {'key': 'clusterId', 'type': 'str'}, @@ -876,7 +1186,9 @@ class ClusterGetProperties(msrest.serialization.Model): 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': '[ConnectivityEndpoint]'}, 'disk_encryption_properties': {'key': 'diskEncryptionProperties', 'type': 'DiskEncryptionProperties'}, 'encryption_in_transit_properties': {'key': 'encryptionInTransitProperties', 'type': 'EncryptionInTransitProperties'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, 'min_supported_tls_version': {'key': 'minSupportedTlsVersion', 'type': 'str'}, + 'excluded_services_config': {'key': 'excludedServicesConfig', 'type': 'ExcludedServicesConfig'}, 'network_properties': {'key': 'networkProperties', 'type': 'NetworkProperties'}, 'compute_isolation_properties': {'key': 'computeIsolationProperties', 'type': 'ComputeIsolationProperties'}, } @@ -887,6 +1199,7 @@ def __init__( ): super(ClusterGetProperties, self).__init__(**kwargs) self.cluster_version = kwargs.get('cluster_version', None) + self.cluster_hdp_version = kwargs.get('cluster_hdp_version', None) self.os_type = kwargs.get('os_type', None) self.tier = kwargs.get('tier', None) self.cluster_id = kwargs.get('cluster_id', None) @@ -902,7 +1215,9 @@ def __init__( self.connectivity_endpoints = kwargs.get('connectivity_endpoints', None) self.disk_encryption_properties = kwargs.get('disk_encryption_properties', None) self.encryption_in_transit_properties = kwargs.get('encryption_in_transit_properties', None) + self.storage_profile = kwargs.get('storage_profile', None) self.min_supported_tls_version = kwargs.get('min_supported_tls_version', None) + self.excluded_services_config = kwargs.get('excluded_services_config', None) self.network_properties = kwargs.get('network_properties', None) self.compute_isolation_properties = kwargs.get('compute_isolation_properties', None) @@ -1071,11 +1386,11 @@ def __init__( class ClusterMonitoringRequest(msrest.serialization.Model): - """The Operations Management Suite (OMS) parameters. + """The cluster monitor parameters. - :param workspace_id: The Operations Management Suite (OMS) workspace ID. + :param workspace_id: The cluster monitor workspace ID. :type workspace_id: str - :param primary_key: The Operations Management Suite (OMS) workspace key. + :param primary_key: The cluster monitor workspace key. :type primary_key: str """ @@ -1094,13 +1409,11 @@ def __init__( class ClusterMonitoringResponse(msrest.serialization.Model): - """The Operations Management Suite (OMS) status response. + """The cluster monitoring status response. - :param cluster_monitoring_enabled: The status of the Operations Management Suite (OMS) on the - HDInsight cluster. + :param cluster_monitoring_enabled: The status of the monitor on the HDInsight cluster. :type cluster_monitoring_enabled: bool - :param workspace_id: The workspace ID of the Operations Management Suite (OMS) on the HDInsight - cluster. + :param workspace_id: The workspace ID of the monitor on the HDInsight cluster. :type workspace_id: str """ @@ -1165,6 +1478,8 @@ class ComponentsC51Ht8SchemasClusteridentityPropertiesUserassignedidentitiesAddi :vartype principal_id: str :ivar client_id: The client id of user assigned identity. :vartype client_id: str + :param tenant_id: The tenant id of user assigned identity. + :type tenant_id: str """ _validation = { @@ -1175,6 +1490,7 @@ class ComponentsC51Ht8SchemasClusteridentityPropertiesUserassignedidentitiesAddi _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'client_id': {'key': 'clientId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, } def __init__( @@ -1184,6 +1500,7 @@ def __init__( super(ComponentsC51Ht8SchemasClusteridentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) self.principal_id = None self.client_id = None + self.tenant_id = kwargs.get('tenant_id', None) class ComputeIsolationProperties(msrest.serialization.Model): @@ -1205,7 +1522,7 @@ def __init__( **kwargs ): super(ComputeIsolationProperties, self).__init__(**kwargs) - self.enable_compute_isolation = kwargs.get('enable_compute_isolation', None) + self.enable_compute_isolation = kwargs.get('enable_compute_isolation', False) self.host_sku = kwargs.get('host_sku', None) @@ -1239,6 +1556,8 @@ class ConnectivityEndpoint(msrest.serialization.Model): :type location: str :param port: The port to connect to. :type port: int + :param private_ip_address: The private ip address of the endpoint. + :type private_ip_address: str """ _attribute_map = { @@ -1246,6 +1565,7 @@ class ConnectivityEndpoint(msrest.serialization.Model): 'protocol': {'key': 'protocol', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'port': {'key': 'port', 'type': 'int'}, + 'private_ip_address': {'key': 'privateIPAddress', 'type': 'str'}, } def __init__( @@ -1257,6 +1577,7 @@ def __init__( self.protocol = kwargs.get('protocol', None) self.location = kwargs.get('location', None) self.port = kwargs.get('port', None) + self.private_ip_address = kwargs.get('private_ip_address', None) class DataDisksGroups(msrest.serialization.Model): @@ -1293,6 +1614,38 @@ def __init__( self.disk_size_gb = None +class Dimension(msrest.serialization.Model): + """The definition of Dimension. + + :param name: The name of the dimension. + :type name: str + :param display_name: The display name of the dimension. + :type display_name: str + :param internal_name: The display name of the dimension. + :type internal_name: str + :param to_be_exported_for_shoebox: The flag indicates whether the metric will be exported for + shoebox or not. + :type to_be_exported_for_shoebox: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.internal_name = kwargs.get('internal_name', None) + self.to_be_exported_for_shoebox = kwargs.get('to_be_exported_for_shoebox', None) + + class DiskBillingMeters(msrest.serialization.Model): """The disk billing meters. @@ -1428,6 +1781,29 @@ def __init__( self.message = kwargs.get('message', None) +class ExcludedServicesConfig(msrest.serialization.Model): + """The configuration that services will be excluded when creating cluster. + + :param excluded_services_config_id: The config id of excluded services. + :type excluded_services_config_id: str + :param excluded_services_list: The list of excluded services. + :type excluded_services_list: str + """ + + _attribute_map = { + 'excluded_services_config_id': {'key': 'excludedServicesConfigId', 'type': 'str'}, + 'excluded_services_list': {'key': 'excludedServicesList', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExcludedServicesConfig, self).__init__(**kwargs) + self.excluded_services_config_id = kwargs.get('excluded_services_config_id', None) + self.excluded_services_list = kwargs.get('excluded_services_list', None) + + class ExecuteScriptActionParameters(msrest.serialization.Model): """The parameters for the script actions to execute on a running cluster. @@ -1568,10 +1944,13 @@ class KafkaRestProperties(msrest.serialization.Model): :param client_group_info: The information of AAD security group. :type client_group_info: ~azure.mgmt.hdinsight.models.ClientGroupInfo + :param configuration_override: The configurations that need to be overriden. + :type configuration_override: dict[str, str] """ _attribute_map = { 'client_group_info': {'key': 'clientGroupInfo', 'type': 'ClientGroupInfo'}, + 'configuration_override': {'key': 'configurationOverride', 'type': '{str}'}, } def __init__( @@ -1580,6 +1959,7 @@ def __init__( ): super(KafkaRestProperties, self).__init__(**kwargs) self.client_group_info = kwargs.get('client_group_info', None) + self.configuration_override = kwargs.get('configuration_override', None) class LinuxOperatingSystemProfile(msrest.serialization.Model): @@ -1632,6 +2012,148 @@ def __init__( self.localized_value = kwargs.get('localized_value', None) +class MetricSpecifications(msrest.serialization.Model): + """The details of metric specifications. + + :param name: The name of the metric specification. + :type name: str + :param display_name: The display name of the metric specification. + :type display_name: str + :param display_description: The display description of the metric specification. + :type display_description: str + :param unit: The unit of the metric specification. + :type unit: str + :param aggregation_type: The aggregation type of the metric specification. + :type aggregation_type: str + :param supported_aggregation_types: The supported aggregation types of the metric + specification. + :type supported_aggregation_types: list[str] + :param supported_time_grain_types: The supported time grain types of the metric specification. + :type supported_time_grain_types: list[str] + :param enable_regional_mdm_account: The flag indicates whether enable regional mdm account or + not. + :type enable_regional_mdm_account: bool + :param source_mdm_account: The source mdm account. + :type source_mdm_account: str + :param source_mdm_namespace: The source mdm namespace. + :type source_mdm_namespace: str + :param metric_filter_pattern: The metric filter pattern. + :type metric_filter_pattern: str + :param fill_gap_with_zero: The flag indicates whether filling gap with zero. + :type fill_gap_with_zero: bool + :param category: The category of the metric. + :type category: str + :param resource_id_dimension_name_override: The override name of resource id dimension name. + :type resource_id_dimension_name_override: str + :param is_internal: The flag indicates whether the metric is internal or not. + :type is_internal: bool + :param delegate_metric_name_override: The override name of delegate metric. + :type delegate_metric_name_override: str + :param dimensions: The dimensions of the metric specification. + :type dimensions: list[~azure.mgmt.hdinsight.models.Dimension] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'bool'}, + 'source_mdm_account': {'key': 'sourceMdmAccount', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + 'metric_filter_pattern': {'key': 'metricFilterPattern', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + 'is_internal': {'key': 'isInternal', 'type': 'bool'}, + 'delegate_metric_name_override': {'key': 'delegateMetricNameOverride', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricSpecifications, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.supported_aggregation_types = kwargs.get('supported_aggregation_types', None) + self.supported_time_grain_types = kwargs.get('supported_time_grain_types', None) + self.enable_regional_mdm_account = kwargs.get('enable_regional_mdm_account', None) + self.source_mdm_account = kwargs.get('source_mdm_account', None) + self.source_mdm_namespace = kwargs.get('source_mdm_namespace', None) + self.metric_filter_pattern = kwargs.get('metric_filter_pattern', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) + self.is_internal = kwargs.get('is_internal', None) + self.delegate_metric_name_override = kwargs.get('delegate_metric_name_override', None) + self.dimensions = kwargs.get('dimensions', None) + + +class NameAvailabilityCheckRequestParameters(msrest.serialization.Model): + """The request spec of checking name availability. + + :param name: The resource name. + :type name: str + :param type: The resource type. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NameAvailabilityCheckRequestParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class NameAvailabilityCheckResult(msrest.serialization.Model): + """The response spec of checking name availability. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name_available: This indicates whether the name is available. + :type name_available: bool + :ivar reason: The reason of the result. + :vartype reason: str + :ivar message: The related message. + :vartype message: str + """ + + _validation = { + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NameAvailabilityCheckResult, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.reason = None + self.message = None + + class NetworkProperties(msrest.serialization.Model): """The network properties. @@ -1665,11 +2187,14 @@ class Operation(msrest.serialization.Model): :type name: str :param display: The object that represents the operation. :type display: ~azure.mgmt.hdinsight.models.OperationDisplay + :param properties: The operation properties. + :type properties: ~azure.mgmt.hdinsight.models.OperationProperties """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'properties': {'key': 'properties', 'type': 'OperationProperties'}, } def __init__( @@ -1679,6 +2204,7 @@ def __init__( super(Operation, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.display = kwargs.get('display', None) + self.properties = kwargs.get('properties', None) class OperationDisplay(msrest.serialization.Model): @@ -1690,12 +2216,15 @@ class OperationDisplay(msrest.serialization.Model): :type resource: str :param operation: The operation type: read, write, delete, etc. :type operation: str + :param description: Localized friendly description for the operation. + :type description: str """ _attribute_map = { 'provider': {'key': 'provider', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'str'}, 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, } def __init__( @@ -1706,6 +2235,7 @@ def __init__( 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): @@ -1731,28 +2261,23 @@ def __init__( self.next_link = kwargs.get('next_link', None) -class OperationResource(msrest.serialization.Model): - """The azure async operation response. +class OperationProperties(msrest.serialization.Model): + """The details of operation. - :param status: The async operation state. Possible values include: "InProgress", "Succeeded", - "Failed". - :type status: str or ~azure.mgmt.hdinsight.models.AsyncOperationState - :param error: The operation error information. - :type error: ~azure.mgmt.hdinsight.models.Errors + :param service_specification: The specification of the service. + :type service_specification: ~azure.mgmt.hdinsight.models.ServiceSpecification """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'Errors'}, + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, } def __init__( self, **kwargs ): - super(OperationResource, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.error = kwargs.get('error', None) + super(OperationProperties, self).__init__(**kwargs) + self.service_specification = kwargs.get('service_specification', None) class OsProfile(msrest.serialization.Model): @@ -1774,38 +2299,6 @@ def __init__( self.linux_operating_system_profile = kwargs.get('linux_operating_system_profile', None) -class ProxyResource(Resource): - """The resource model definition for a ARM proxy resource. It will have everything other than required location and tags. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource Id for the resource. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProxyResource, self).__init__(**kwargs) - - class QuotaCapability(msrest.serialization.Model): """The regional quota capability. @@ -1907,6 +2400,8 @@ class Role(msrest.serialization.Model): :type min_instance_count: int :param target_instance_count: The instance count of the cluster. :type target_instance_count: int + :param vm_group_name: The name of the virtual machine group. + :type vm_group_name: str :param autoscale_configuration: The autoscale configurations. :type autoscale_configuration: ~azure.mgmt.hdinsight.models.Autoscale :param hardware_profile: The hardware profile. @@ -1919,18 +2414,22 @@ class Role(msrest.serialization.Model): :type data_disks_groups: list[~azure.mgmt.hdinsight.models.DataDisksGroups] :param script_actions: The list of script actions on the role. :type script_actions: list[~azure.mgmt.hdinsight.models.ScriptAction] + :param encrypt_data_disks: Indicates whether encrypt the data disks. + :type encrypt_data_disks: bool """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'min_instance_count': {'key': 'minInstanceCount', 'type': 'int'}, 'target_instance_count': {'key': 'targetInstanceCount', 'type': 'int'}, + 'vm_group_name': {'key': 'VMGroupName', 'type': 'str'}, 'autoscale_configuration': {'key': 'autoscale', 'type': 'Autoscale'}, 'hardware_profile': {'key': 'hardwareProfile', 'type': 'HardwareProfile'}, 'os_profile': {'key': 'osProfile', 'type': 'OsProfile'}, 'virtual_network_profile': {'key': 'virtualNetworkProfile', 'type': 'VirtualNetworkProfile'}, 'data_disks_groups': {'key': 'dataDisksGroups', 'type': '[DataDisksGroups]'}, 'script_actions': {'key': 'scriptActions', 'type': '[ScriptAction]'}, + 'encrypt_data_disks': {'key': 'encryptDataDisks', 'type': 'bool'}, } def __init__( @@ -1941,12 +2440,14 @@ def __init__( self.name = kwargs.get('name', None) self.min_instance_count = kwargs.get('min_instance_count', None) self.target_instance_count = kwargs.get('target_instance_count', None) + self.vm_group_name = kwargs.get('vm_group_name', None) self.autoscale_configuration = kwargs.get('autoscale_configuration', None) self.hardware_profile = kwargs.get('hardware_profile', None) self.os_profile = kwargs.get('os_profile', None) self.virtual_network_profile = kwargs.get('virtual_network_profile', None) self.data_disks_groups = kwargs.get('data_disks_groups', None) self.script_actions = kwargs.get('script_actions', None) + self.encrypt_data_disks = kwargs.get('encrypt_data_disks', False) class RuntimeScriptAction(msrest.serialization.Model): @@ -2252,8 +2753,8 @@ class SecurityProfile(msrest.serialization.Model): :type cluster_users_group_d_ns: list[str] :param aadds_resource_id: The resource ID of the user's Azure Active Directory Domain Service. :type aadds_resource_id: str - :param msi_resource_id: User assigned identity that has permissions to read and create cluster- - related artifacts in the user's AADDS. + :param msi_resource_id: User assigned identity that has permissions to read and create + cluster-related artifacts in the user's AADDS. :type msi_resource_id: str """ @@ -2290,6 +2791,25 @@ def __init__( self.msi_resource_id = kwargs.get('msi_resource_id', None) +class ServiceSpecification(msrest.serialization.Model): + """The specification of the service. + + :param metric_specifications: The metric specifications. + :type metric_specifications: list[~azure.mgmt.hdinsight.models.MetricSpecifications] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecifications]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + class SshProfile(msrest.serialization.Model): """The list of SSH public keys. @@ -2348,6 +2868,10 @@ class StorageAccount(msrest.serialization.Model): :param msi_resource_id: The managed identity (MSI) that is allowed to access the storage account, only to be specified for Azure Data Lake Storage Gen 2. :type msi_resource_id: str + :param saskey: The shared access signature key. + :type saskey: str + :param fileshare: The file share name. + :type fileshare: str """ _attribute_map = { @@ -2358,6 +2882,8 @@ class StorageAccount(msrest.serialization.Model): 'key': {'key': 'key', 'type': 'str'}, 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'msi_resource_id': {'key': 'msiResourceId', 'type': 'str'}, + 'saskey': {'key': 'saskey', 'type': 'str'}, + 'fileshare': {'key': 'fileshare', 'type': 'str'}, } def __init__( @@ -2372,6 +2898,8 @@ def __init__( self.key = kwargs.get('key', None) self.resource_id = kwargs.get('resource_id', None) self.msi_resource_id = kwargs.get('msi_resource_id', None) + self.saskey = kwargs.get('saskey', None) + self.fileshare = kwargs.get('fileshare', None) class StorageProfile(msrest.serialization.Model): @@ -2393,6 +2921,33 @@ def __init__( self.storageaccounts = kwargs.get('storageaccounts', None) +class UpdateClusterIdentityCertificateParameters(msrest.serialization.Model): + """The update cluster identity certificate request parameters. + + :param application_id: The application id. + :type application_id: str + :param certificate: The certificate in base64 encoded format. + :type certificate: str + :param certificate_password: The password of the certificate. + :type certificate_password: str + """ + + _attribute_map = { + 'application_id': {'key': 'applicationId', 'type': 'str'}, + 'certificate': {'key': 'certificate', 'type': 'str'}, + 'certificate_password': {'key': 'certificatePassword', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateClusterIdentityCertificateParameters, self).__init__(**kwargs) + self.application_id = kwargs.get('application_id', None) + self.certificate = kwargs.get('certificate', None) + self.certificate_password = kwargs.get('certificate_password', None) + + class UpdateGatewaySettingsParameters(msrest.serialization.Model): """The update gateway settings request parameters. @@ -2429,9 +2984,9 @@ class Usage(msrest.serialization.Model): :param unit: The type of measurement for usage. :type unit: str :param current_value: The current usage. - :type current_value: int + :type current_value: long :param limit: The maximum allowed usage. - :type limit: int + :type limit: long :ivar name: The details about the localizable name of the used resource. :vartype name: ~azure.mgmt.hdinsight.models.LocalizedName """ @@ -2442,8 +2997,8 @@ class Usage(msrest.serialization.Model): _attribute_map = { 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, 'name': {'key': 'name', 'type': 'LocalizedName'}, } @@ -2477,6 +3032,37 @@ def __init__( self.value = kwargs.get('value', None) +class ValidationErrorInfo(msrest.serialization.Model): + """The validation error information. + + :param code: The error code. + :type code: str + :param message: The error message. + :type message: str + :param error_resource: The error resource. + :type error_resource: str + :param message_arguments: The message arguments. + :type message_arguments: list[str] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'error_resource': {'key': 'errorResource', 'type': 'str'}, + 'message_arguments': {'key': 'messageArguments', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ValidationErrorInfo, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.error_resource = kwargs.get('error_resource', None) + self.message_arguments = kwargs.get('message_arguments', None) + + class VersionsCapability(msrest.serialization.Model): """The version capability. @@ -2504,7 +3090,7 @@ class VersionSpec(msrest.serialization.Model): :param display_name: The display name. :type display_name: str :param is_default: Whether or not the version is the default version. - :type is_default: str + :type is_default: bool :param component_versions: The component version property. :type component_versions: dict[str, str] """ @@ -2512,7 +3098,7 @@ class VersionSpec(msrest.serialization.Model): _attribute_map = { 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, 'component_versions': {'key': 'componentVersions', 'type': '{str}'}, } @@ -2563,8 +3149,16 @@ class VmSizeCompatibilityFilter(msrest.serialization.Model): :type node_types: list[str] :param cluster_versions: The list of cluster versions. :type cluster_versions: list[str] - :param vmsizes: The list of virtual machine sizes. - :type vmsizes: list[str] + :param os_type: The list of OS types. + :type os_type: list[str] + :param vm_sizes: The list of virtual machine sizes. + :type vm_sizes: list[str] + :param esp_applied: Whether apply for ESP cluster. 'true' means only for ESP, 'false' means + only for non-ESP, null or empty string or others mean for both. + :type esp_applied: str + :param compute_isolation_supported: Whether support compute isolation. 'true' means only for + ComputeIsolationEnabled, 'false' means only for regular cluster. + :type compute_isolation_supported: str """ _attribute_map = { @@ -2573,7 +3167,10 @@ class VmSizeCompatibilityFilter(msrest.serialization.Model): 'cluster_flavors': {'key': 'ClusterFlavors', 'type': '[str]'}, 'node_types': {'key': 'NodeTypes', 'type': '[str]'}, 'cluster_versions': {'key': 'ClusterVersions', 'type': '[str]'}, - 'vmsizes': {'key': 'vmsizes', 'type': '[str]'}, + 'os_type': {'key': 'OsType', 'type': '[str]'}, + 'vm_sizes': {'key': 'VMSizes', 'type': '[str]'}, + 'esp_applied': {'key': 'ESPApplied', 'type': 'str'}, + 'compute_isolation_supported': {'key': 'ComputeIsolationSupported', 'type': 'str'}, } def __init__( @@ -2586,14 +3183,17 @@ def __init__( self.cluster_flavors = kwargs.get('cluster_flavors', None) self.node_types = kwargs.get('node_types', None) self.cluster_versions = kwargs.get('cluster_versions', None) - self.vmsizes = kwargs.get('vmsizes', None) + self.os_type = kwargs.get('os_type', None) + self.vm_sizes = kwargs.get('vm_sizes', None) + self.esp_applied = kwargs.get('esp_applied', None) + self.compute_isolation_supported = kwargs.get('compute_isolation_supported', None) class VmSizeCompatibilityFilterV2(msrest.serialization.Model): """This class represent a single filter object that defines a multidimensional set. The dimensions of this set are Regions, ClusterFlavors, NodeTypes and ClusterVersions. The constraint should be defined based on the following: FilterMode (Exclude vs Include), VMSizes (the vm sizes in affect of exclusion/inclusion) and the ordering of the Filters. Later filters override previous settings if conflicted. :param filter_mode: The filtering mode. Effectively this can enabling or disabling the VM sizes - in a particular set. Possible values include: "Exclude", "Include". + in a particular set. Possible values include: "Exclude", "Include", "Recommend", "Default". :type filter_mode: str or ~azure.mgmt.hdinsight.models.FilterMode :param regions: The list of regions under the effect of the filter. :type regions: list[str] @@ -2633,6 +3233,65 @@ def __init__( self.vm_sizes = kwargs.get('vm_sizes', None) +class VmSizeProperty(msrest.serialization.Model): + """The vm size property. + + :param name: The vm size name. + :type name: str + :param cores: The number of cores that the vm size has. + :type cores: int + :param data_disk_storage_tier: The data disk storage tier of the vm size. + :type data_disk_storage_tier: str + :param label: The label of the vm size. + :type label: str + :param max_data_disk_count: The max data disk count of the vm size. + :type max_data_disk_count: long + :param memory_in_mb: The memory whose unit is MB of the vm size. + :type memory_in_mb: long + :param supported_by_virtual_machines: This indicates this vm size is supported by virtual + machines or not. + :type supported_by_virtual_machines: bool + :param supported_by_web_worker_roles: The indicates this vm size is supported by web worker + roles or not. + :type supported_by_web_worker_roles: bool + :param virtual_machine_resource_disk_size_in_mb: The virtual machine resource disk size whose + unit is MB of the vm size. + :type virtual_machine_resource_disk_size_in_mb: long + :param web_worker_resource_disk_size_in_mb: The web worker resource disk size whose unit is MB + of the vm size. + :type web_worker_resource_disk_size_in_mb: long + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'cores': {'key': 'cores', 'type': 'int'}, + 'data_disk_storage_tier': {'key': 'dataDiskStorageTier', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'max_data_disk_count': {'key': 'maxDataDiskCount', 'type': 'long'}, + 'memory_in_mb': {'key': 'memoryInMb', 'type': 'long'}, + 'supported_by_virtual_machines': {'key': 'supportedByVirtualMachines', 'type': 'bool'}, + 'supported_by_web_worker_roles': {'key': 'supportedByWebWorkerRoles', 'type': 'bool'}, + 'virtual_machine_resource_disk_size_in_mb': {'key': 'virtualMachineResourceDiskSizeInMb', 'type': 'long'}, + 'web_worker_resource_disk_size_in_mb': {'key': 'webWorkerResourceDiskSizeInMb', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(VmSizeProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.cores = kwargs.get('cores', None) + self.data_disk_storage_tier = kwargs.get('data_disk_storage_tier', None) + self.label = kwargs.get('label', None) + self.max_data_disk_count = kwargs.get('max_data_disk_count', None) + self.memory_in_mb = kwargs.get('memory_in_mb', None) + self.supported_by_virtual_machines = kwargs.get('supported_by_virtual_machines', None) + self.supported_by_web_worker_roles = kwargs.get('supported_by_web_worker_roles', None) + self.virtual_machine_resource_disk_size_in_mb = kwargs.get('virtual_machine_resource_disk_size_in_mb', None) + self.web_worker_resource_disk_size_in_mb = kwargs.get('web_worker_resource_disk_size_in_mb', None) + + class VmSizesCapability(msrest.serialization.Model): """The virtual machine sizes capability. diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models_py3.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models_py3.py index 803dd2e745af..7942dccd68bb 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models_py3.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models_py3.py @@ -6,7 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Dict, List, Optional, Union +import datetime +from typing import Any, Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization @@ -14,6 +15,58 @@ from ._hd_insight_management_client_enums import * +class AaddsResourceDetails(msrest.serialization.Model): + """The Azure active directory domain service resource details. + + :param domain_name: The Azure active directory domain service name. + :type domain_name: str + :param initial_sync_complete: This indicates whether initial sync complete or not. + :type initial_sync_complete: bool + :param ldaps_enabled: This indicates whether enable ldaps or not. + :type ldaps_enabled: bool + :param ldaps_public_certificate_in_base64: The base 64 format string of public ldap + certificate. + :type ldaps_public_certificate_in_base64: str + :param resource_id: The resource id of azure active directory domain service. + :type resource_id: str + :param subnet_id: The subnet resource id. + :type subnet_id: str + :param tenant_id: The tenant id of azure active directory domain service . + :type tenant_id: str + """ + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'initial_sync_complete': {'key': 'initialSyncComplete', 'type': 'bool'}, + 'ldaps_enabled': {'key': 'ldapsEnabled', 'type': 'bool'}, + 'ldaps_public_certificate_in_base64': {'key': 'ldapsPublicCertificateInBase64', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'subnet_id': {'key': 'subnetId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + *, + domain_name: Optional[str] = None, + initial_sync_complete: Optional[bool] = None, + ldaps_enabled: Optional[bool] = None, + ldaps_public_certificate_in_base64: Optional[str] = None, + resource_id: Optional[str] = None, + subnet_id: Optional[str] = None, + tenant_id: Optional[str] = None, + **kwargs + ): + super(AaddsResourceDetails, self).__init__(**kwargs) + self.domain_name = domain_name + self.initial_sync_complete = initial_sync_complete + self.ldaps_enabled = ldaps_enabled + self.ldaps_public_certificate_in_base64 = ldaps_public_certificate_in_base64 + self.resource_id = resource_id + self.subnet_id = subnet_id + self.tenant_id = tenant_id + + class Resource(msrest.serialization.Model): """The core properties of ARM resources. @@ -49,7 +102,39 @@ def __init__( self.type = None -class Application(Resource): +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class Application(ProxyResource): """The HDInsight cluster application. Variables are only populated by the server, and will be ignored when sending a request. @@ -106,12 +191,15 @@ class ApplicationGetEndpoint(msrest.serialization.Model): :type destination_port: int :param public_port: The public port to connect to. :type public_port: int + :param private_ip_address: The private ip address of the endpoint. + :type private_ip_address: str """ _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'destination_port': {'key': 'destinationPort', 'type': 'int'}, 'public_port': {'key': 'publicPort', 'type': 'int'}, + 'private_ip_address': {'key': 'privateIPAddress', 'type': 'str'}, } def __init__( @@ -120,36 +208,48 @@ def __init__( location: Optional[str] = None, destination_port: Optional[int] = None, public_port: Optional[int] = None, + private_ip_address: Optional[str] = None, **kwargs ): super(ApplicationGetEndpoint, self).__init__(**kwargs) self.location = location self.destination_port = destination_port self.public_port = public_port + self.private_ip_address = private_ip_address class ApplicationGetHttpsEndpoint(msrest.serialization.Model): """Gets the application HTTP endpoints. + Variables are only populated by the server, and will be ignored when sending a request. + :param access_modes: The list of access modes for the application. :type access_modes: list[str] - :param location: The location of the endpoint. - :type location: str + :ivar location: The location of the endpoint. + :vartype location: str :param destination_port: The destination port to connect to. :type destination_port: int - :param public_port: The public port to connect to. - :type public_port: int + :ivar public_port: The public port to connect to. + :vartype public_port: int + :param private_ip_address: The private ip address of the endpoint. + :type private_ip_address: str :param sub_domain_suffix: The subdomain suffix of the application. :type sub_domain_suffix: str :param disable_gateway_auth: The value indicates whether to disable GatewayAuth. :type disable_gateway_auth: bool """ + _validation = { + 'location': {'readonly': True}, + 'public_port': {'readonly': True}, + } + _attribute_map = { 'access_modes': {'key': 'accessModes', 'type': '[str]'}, 'location': {'key': 'location', 'type': 'str'}, 'destination_port': {'key': 'destinationPort', 'type': 'int'}, 'public_port': {'key': 'publicPort', 'type': 'int'}, + 'private_ip_address': {'key': 'privateIPAddress', 'type': 'str'}, 'sub_domain_suffix': {'key': 'subDomainSuffix', 'type': 'str'}, 'disable_gateway_auth': {'key': 'disableGatewayAuth', 'type': 'bool'}, } @@ -158,18 +258,18 @@ def __init__( self, *, access_modes: Optional[List[str]] = None, - location: Optional[str] = None, destination_port: Optional[int] = None, - public_port: Optional[int] = None, + private_ip_address: Optional[str] = None, sub_domain_suffix: Optional[str] = None, disable_gateway_auth: Optional[bool] = None, **kwargs ): super(ApplicationGetHttpsEndpoint, self).__init__(**kwargs) self.access_modes = access_modes - self.location = location + self.location = None self.destination_port = destination_port - self.public_port = public_port + self.public_port = None + self.private_ip_address = private_ip_address self.sub_domain_suffix = sub_domain_suffix self.disable_gateway_auth = disable_gateway_auth @@ -281,6 +381,33 @@ def __init__( self.marketplace_identifier = None +class AsyncOperationResult(msrest.serialization.Model): + """The azure async operation response. + + :param status: The async operation state. Possible values include: "InProgress", "Succeeded", + "Failed". + :type status: str or ~azure.mgmt.hdinsight.models.AsyncOperationState + :param error: The operation error information. + :type error: ~azure.mgmt.hdinsight.models.Errors + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Errors'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "AsyncOperationState"]] = None, + error: Optional["Errors"] = None, + **kwargs + ): + super(AsyncOperationResult, self).__init__(**kwargs) + self.status = status + self.error = error + + class Autoscale(msrest.serialization.Model): """The autoscale request parameters. @@ -437,6 +564,120 @@ def __init__( self.max_instance_count = max_instance_count +class AzureMonitorRequest(msrest.serialization.Model): + """The azure monitor parameters. + + :param workspace_id: The Log Analytics workspace ID. + :type workspace_id: str + :param primary_key: The Log Analytics workspace key. + :type primary_key: str + :param selected_configurations: The selected configurations. + :type selected_configurations: ~azure.mgmt.hdinsight.models.AzureMonitorSelectedConfigurations + """ + + _attribute_map = { + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'selected_configurations': {'key': 'selectedConfigurations', 'type': 'AzureMonitorSelectedConfigurations'}, + } + + def __init__( + self, + *, + workspace_id: Optional[str] = None, + primary_key: Optional[str] = None, + selected_configurations: Optional["AzureMonitorSelectedConfigurations"] = None, + **kwargs + ): + super(AzureMonitorRequest, self).__init__(**kwargs) + self.workspace_id = workspace_id + self.primary_key = primary_key + self.selected_configurations = selected_configurations + + +class AzureMonitorResponse(msrest.serialization.Model): + """The azure monitor status response. + + :param cluster_monitoring_enabled: The status of the monitor on the HDInsight cluster. + :type cluster_monitoring_enabled: bool + :param workspace_id: The workspace ID of the monitor on the HDInsight cluster. + :type workspace_id: str + :param selected_configurations: The selected configurations. + :type selected_configurations: ~azure.mgmt.hdinsight.models.AzureMonitorSelectedConfigurations + """ + + _attribute_map = { + 'cluster_monitoring_enabled': {'key': 'clusterMonitoringEnabled', 'type': 'bool'}, + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + 'selected_configurations': {'key': 'selectedConfigurations', 'type': 'AzureMonitorSelectedConfigurations'}, + } + + def __init__( + self, + *, + cluster_monitoring_enabled: Optional[bool] = None, + workspace_id: Optional[str] = None, + selected_configurations: Optional["AzureMonitorSelectedConfigurations"] = None, + **kwargs + ): + super(AzureMonitorResponse, self).__init__(**kwargs) + self.cluster_monitoring_enabled = cluster_monitoring_enabled + self.workspace_id = workspace_id + self.selected_configurations = selected_configurations + + +class AzureMonitorSelectedConfigurations(msrest.serialization.Model): + """The selected configurations for azure monitor. + + :param configuration_version: The configuration version. + :type configuration_version: str + :param global_configurations: The global configurations of selected configurations. + :type global_configurations: dict[str, str] + :param table_list: The table list. + :type table_list: list[~azure.mgmt.hdinsight.models.AzureMonitorTableConfiguration] + """ + + _attribute_map = { + 'configuration_version': {'key': 'configurationVersion', 'type': 'str'}, + 'global_configurations': {'key': 'globalConfigurations', 'type': '{str}'}, + 'table_list': {'key': 'tableList', 'type': '[AzureMonitorTableConfiguration]'}, + } + + def __init__( + self, + *, + configuration_version: Optional[str] = None, + global_configurations: Optional[Dict[str, str]] = None, + table_list: Optional[List["AzureMonitorTableConfiguration"]] = None, + **kwargs + ): + super(AzureMonitorSelectedConfigurations, self).__init__(**kwargs) + self.configuration_version = configuration_version + self.global_configurations = global_configurations + self.table_list = table_list + + +class AzureMonitorTableConfiguration(msrest.serialization.Model): + """The table configuration for the Log Analytics integration. + + :param name: The name. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + **kwargs + ): + super(AzureMonitorTableConfiguration, self).__init__(**kwargs) + self.name = name + + class BillingMeters(msrest.serialization.Model): """The billing meters. @@ -502,18 +743,30 @@ def __init__( class BillingResponseListResult(msrest.serialization.Model): """The response for the operation to get regional billingSpecs for a subscription. + Variables are only populated by the server, and will be ignored when sending a request. + :param vm_sizes: The virtual machine sizes to include or exclude. :type vm_sizes: list[str] + :param vm_sizes_with_encryption_at_host: The vm sizes which enable encryption at host. + :type vm_sizes_with_encryption_at_host: list[str] :param vm_size_filters: The virtual machine filtering mode. Effectively this can enabling or disabling the virtual machine sizes in a particular set. :type vm_size_filters: list[~azure.mgmt.hdinsight.models.VmSizeCompatibilityFilterV2] + :ivar vm_size_properties: The vm size properties. + :vartype vm_size_properties: list[~azure.mgmt.hdinsight.models.VmSizeProperty] :param billing_resources: The billing and managed disk billing resources for a region. :type billing_resources: list[~azure.mgmt.hdinsight.models.BillingResources] """ + _validation = { + 'vm_size_properties': {'readonly': True}, + } + _attribute_map = { 'vm_sizes': {'key': 'vmSizes', 'type': '[str]'}, + 'vm_sizes_with_encryption_at_host': {'key': 'vmSizesWithEncryptionAtHost', 'type': '[str]'}, 'vm_size_filters': {'key': 'vmSizeFilters', 'type': '[VmSizeCompatibilityFilterV2]'}, + 'vm_size_properties': {'key': 'vmSizeProperties', 'type': '[VmSizeProperty]'}, 'billing_resources': {'key': 'billingResources', 'type': '[BillingResources]'}, } @@ -521,13 +774,16 @@ def __init__( self, *, vm_sizes: Optional[List[str]] = None, + vm_sizes_with_encryption_at_host: Optional[List[str]] = None, vm_size_filters: Optional[List["VmSizeCompatibilityFilterV2"]] = None, billing_resources: Optional[List["BillingResources"]] = None, **kwargs ): super(BillingResponseListResult, self).__init__(**kwargs) self.vm_sizes = vm_sizes + self.vm_sizes_with_encryption_at_host = vm_sizes_with_encryption_at_host self.vm_size_filters = vm_size_filters + self.vm_size_properties = None self.billing_resources = billing_resources @@ -540,10 +796,10 @@ class CapabilitiesResult(msrest.serialization.Model): :type versions: dict[str, ~azure.mgmt.hdinsight.models.VersionsCapability] :param regions: The virtual machine size compatibility features. :type regions: dict[str, ~azure.mgmt.hdinsight.models.RegionsCapability] - :param vm_sizes: The virtual machine sizes. - :type vm_sizes: dict[str, ~azure.mgmt.hdinsight.models.VmSizesCapability] - :param vm_size_filters: The virtual machine size compatibility filters. - :type vm_size_filters: list[~azure.mgmt.hdinsight.models.VmSizeCompatibilityFilter] + :param vmsizes: The virtual machine sizes. + :type vmsizes: dict[str, ~azure.mgmt.hdinsight.models.VmSizesCapability] + :param vmsize_filters: The virtual machine size compatibility filters. + :type vmsize_filters: list[~azure.mgmt.hdinsight.models.VmSizeCompatibilityFilter] :param features: The capability features. :type features: list[str] :ivar quota: The quota capability. @@ -557,8 +813,8 @@ class CapabilitiesResult(msrest.serialization.Model): _attribute_map = { 'versions': {'key': 'versions', 'type': '{VersionsCapability}'}, 'regions': {'key': 'regions', 'type': '{RegionsCapability}'}, - 'vm_sizes': {'key': 'vmSizes', 'type': '{VmSizesCapability}'}, - 'vm_size_filters': {'key': 'vmSize_filters', 'type': '[VmSizeCompatibilityFilter]'}, + 'vmsizes': {'key': 'vmsizes', 'type': '{VmSizesCapability}'}, + 'vmsize_filters': {'key': 'vmsize_filters', 'type': '[VmSizeCompatibilityFilter]'}, 'features': {'key': 'features', 'type': '[str]'}, 'quota': {'key': 'quota', 'type': 'QuotaCapability'}, } @@ -568,16 +824,16 @@ def __init__( *, versions: Optional[Dict[str, "VersionsCapability"]] = None, regions: Optional[Dict[str, "RegionsCapability"]] = None, - vm_sizes: Optional[Dict[str, "VmSizesCapability"]] = None, - vm_size_filters: Optional[List["VmSizeCompatibilityFilter"]] = None, + vmsizes: Optional[Dict[str, "VmSizesCapability"]] = None, + vmsize_filters: Optional[List["VmSizeCompatibilityFilter"]] = None, features: Optional[List[str]] = None, **kwargs ): super(CapabilitiesResult, self).__init__(**kwargs) self.versions = versions self.regions = regions - self.vm_sizes = vm_sizes - self.vm_size_filters = vm_size_filters + self.vmsizes = vmsizes + self.vmsize_filters = vmsize_filters self.features = features self.quota = None @@ -847,6 +1103,94 @@ def __init__( self.compute_isolation_properties = compute_isolation_properties +class ClusterCreateRequestValidationParameters(ClusterCreateParametersExtended): + """The cluster create request specification. + + :param location: The location of the cluster. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param properties: The cluster create parameters. + :type properties: ~azure.mgmt.hdinsight.models.ClusterCreateProperties + :param identity: The identity of the cluster, if configured. + :type identity: ~azure.mgmt.hdinsight.models.ClusterIdentity + :param name: The cluster name. + :type name: str + :param type: The resource type. + :type type: str + :param tenant_id: The tenant id. + :type tenant_id: str + :param fetch_aadds_resource: This indicates whether fetch Aadds resource or not. + :type fetch_aadds_resource: bool + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'ClusterCreateProperties'}, + 'identity': {'key': 'identity', 'type': 'ClusterIdentity'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'fetch_aadds_resource': {'key': 'fetchAaddsResource', 'type': 'bool'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + properties: Optional["ClusterCreateProperties"] = None, + identity: Optional["ClusterIdentity"] = None, + name: Optional[str] = None, + type: Optional[str] = None, + tenant_id: Optional[str] = None, + fetch_aadds_resource: Optional[bool] = None, + **kwargs + ): + super(ClusterCreateRequestValidationParameters, self).__init__(location=location, tags=tags, properties=properties, identity=identity, **kwargs) + self.name = name + self.type = type + self.tenant_id = tenant_id + self.fetch_aadds_resource = fetch_aadds_resource + + +class ClusterCreateValidationResult(msrest.serialization.Model): + """The response of cluster create request validation. + + :param validation_errors: The validation errors. + :type validation_errors: list[~azure.mgmt.hdinsight.models.ValidationErrorInfo] + :param validation_warnings: The validation warnings. + :type validation_warnings: list[~azure.mgmt.hdinsight.models.ValidationErrorInfo] + :param estimated_creation_duration: The estimated creation duration. + :type estimated_creation_duration: ~datetime.timedelta + :param aadds_resources_details: The Azure active directory domain service resource details. + :type aadds_resources_details: list[~azure.mgmt.hdinsight.models.AaddsResourceDetails] + """ + + _attribute_map = { + 'validation_errors': {'key': 'validationErrors', 'type': '[ValidationErrorInfo]'}, + 'validation_warnings': {'key': 'validationWarnings', 'type': '[ValidationErrorInfo]'}, + 'estimated_creation_duration': {'key': 'estimatedCreationDuration', 'type': 'duration'}, + 'aadds_resources_details': {'key': 'aaddsResourcesDetails', 'type': '[AaddsResourceDetails]'}, + } + + def __init__( + self, + *, + validation_errors: Optional[List["ValidationErrorInfo"]] = None, + validation_warnings: Optional[List["ValidationErrorInfo"]] = None, + estimated_creation_duration: Optional[datetime.timedelta] = None, + aadds_resources_details: Optional[List["AaddsResourceDetails"]] = None, + **kwargs + ): + super(ClusterCreateValidationResult, self).__init__(**kwargs) + self.validation_errors = validation_errors + self.validation_warnings = validation_warnings + self.estimated_creation_duration = estimated_creation_duration + self.aadds_resources_details = aadds_resources_details + + class ClusterDefinition(msrest.serialization.Model): """The cluster definition. @@ -857,7 +1201,7 @@ class ClusterDefinition(msrest.serialization.Model): :param component_version: The versions of different services in the cluster. :type component_version: dict[str, str] :param configurations: The cluster configurations. - :type configurations: object + :type configurations: any """ _attribute_map = { @@ -873,7 +1217,7 @@ def __init__( blueprint: Optional[str] = None, kind: Optional[str] = None, component_version: Optional[Dict[str, str]] = None, - configurations: Optional[object] = None, + configurations: Optional[Any] = None, **kwargs ): super(ClusterDefinition, self).__init__(**kwargs) @@ -922,6 +1266,8 @@ class ClusterGetProperties(msrest.serialization.Model): :param cluster_version: The version of the cluster. :type cluster_version: str + :param cluster_hdp_version: The hdp version of the cluster. + :type cluster_hdp_version: str :param os_type: The type of operating system. Possible values include: "Windows", "Linux". :type os_type: str or ~azure.mgmt.hdinsight.models.OSType :param tier: The cluster tier. Possible values include: "Standard", "Premium". @@ -954,8 +1300,12 @@ class ClusterGetProperties(msrest.serialization.Model): :param encryption_in_transit_properties: The encryption-in-transit properties. :type encryption_in_transit_properties: ~azure.mgmt.hdinsight.models.EncryptionInTransitProperties + :param storage_profile: The storage profile. + :type storage_profile: ~azure.mgmt.hdinsight.models.StorageProfile :param min_supported_tls_version: The minimal supported tls version. :type min_supported_tls_version: str + :param excluded_services_config: The excluded services config. + :type excluded_services_config: ~azure.mgmt.hdinsight.models.ExcludedServicesConfig :param network_properties: The network properties. :type network_properties: ~azure.mgmt.hdinsight.models.NetworkProperties :param compute_isolation_properties: The compute isolation properties. @@ -968,6 +1318,7 @@ class ClusterGetProperties(msrest.serialization.Model): _attribute_map = { 'cluster_version': {'key': 'clusterVersion', 'type': 'str'}, + 'cluster_hdp_version': {'key': 'clusterHdpVersion', 'type': 'str'}, 'os_type': {'key': 'osType', 'type': 'str'}, 'tier': {'key': 'tier', 'type': 'str'}, 'cluster_id': {'key': 'clusterId', 'type': 'str'}, @@ -983,7 +1334,9 @@ class ClusterGetProperties(msrest.serialization.Model): 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': '[ConnectivityEndpoint]'}, 'disk_encryption_properties': {'key': 'diskEncryptionProperties', 'type': 'DiskEncryptionProperties'}, 'encryption_in_transit_properties': {'key': 'encryptionInTransitProperties', 'type': 'EncryptionInTransitProperties'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, 'min_supported_tls_version': {'key': 'minSupportedTlsVersion', 'type': 'str'}, + 'excluded_services_config': {'key': 'excludedServicesConfig', 'type': 'ExcludedServicesConfig'}, 'network_properties': {'key': 'networkProperties', 'type': 'NetworkProperties'}, 'compute_isolation_properties': {'key': 'computeIsolationProperties', 'type': 'ComputeIsolationProperties'}, } @@ -993,6 +1346,7 @@ def __init__( *, cluster_definition: "ClusterDefinition", cluster_version: Optional[str] = None, + cluster_hdp_version: Optional[str] = None, os_type: Optional[Union[str, "OSType"]] = None, tier: Optional[Union[str, "Tier"]] = None, cluster_id: Optional[str] = None, @@ -1007,13 +1361,16 @@ def __init__( connectivity_endpoints: Optional[List["ConnectivityEndpoint"]] = None, disk_encryption_properties: Optional["DiskEncryptionProperties"] = None, encryption_in_transit_properties: Optional["EncryptionInTransitProperties"] = None, + storage_profile: Optional["StorageProfile"] = None, min_supported_tls_version: Optional[str] = None, + excluded_services_config: Optional["ExcludedServicesConfig"] = None, network_properties: Optional["NetworkProperties"] = None, compute_isolation_properties: Optional["ComputeIsolationProperties"] = None, **kwargs ): super(ClusterGetProperties, self).__init__(**kwargs) self.cluster_version = cluster_version + self.cluster_hdp_version = cluster_hdp_version self.os_type = os_type self.tier = tier self.cluster_id = cluster_id @@ -1029,7 +1386,9 @@ def __init__( self.connectivity_endpoints = connectivity_endpoints self.disk_encryption_properties = disk_encryption_properties self.encryption_in_transit_properties = encryption_in_transit_properties + self.storage_profile = storage_profile self.min_supported_tls_version = min_supported_tls_version + self.excluded_services_config = excluded_services_config self.network_properties = network_properties self.compute_isolation_properties = compute_isolation_properties @@ -1205,11 +1564,11 @@ def __init__( class ClusterMonitoringRequest(msrest.serialization.Model): - """The Operations Management Suite (OMS) parameters. + """The cluster monitor parameters. - :param workspace_id: The Operations Management Suite (OMS) workspace ID. + :param workspace_id: The cluster monitor workspace ID. :type workspace_id: str - :param primary_key: The Operations Management Suite (OMS) workspace key. + :param primary_key: The cluster monitor workspace key. :type primary_key: str """ @@ -1231,13 +1590,11 @@ def __init__( class ClusterMonitoringResponse(msrest.serialization.Model): - """The Operations Management Suite (OMS) status response. + """The cluster monitoring status response. - :param cluster_monitoring_enabled: The status of the Operations Management Suite (OMS) on the - HDInsight cluster. + :param cluster_monitoring_enabled: The status of the monitor on the HDInsight cluster. :type cluster_monitoring_enabled: bool - :param workspace_id: The workspace ID of the Operations Management Suite (OMS) on the HDInsight - cluster. + :param workspace_id: The workspace ID of the monitor on the HDInsight cluster. :type workspace_id: str """ @@ -1309,6 +1666,8 @@ class ComponentsC51Ht8SchemasClusteridentityPropertiesUserassignedidentitiesAddi :vartype principal_id: str :ivar client_id: The client id of user assigned identity. :vartype client_id: str + :param tenant_id: The tenant id of user assigned identity. + :type tenant_id: str """ _validation = { @@ -1319,15 +1678,19 @@ class ComponentsC51Ht8SchemasClusteridentityPropertiesUserassignedidentitiesAddi _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'client_id': {'key': 'clientId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, } def __init__( self, + *, + tenant_id: Optional[str] = None, **kwargs ): super(ComponentsC51Ht8SchemasClusteridentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) self.principal_id = None self.client_id = None + self.tenant_id = tenant_id class ComputeIsolationProperties(msrest.serialization.Model): @@ -1347,7 +1710,7 @@ class ComputeIsolationProperties(msrest.serialization.Model): def __init__( self, *, - enable_compute_isolation: Optional[bool] = None, + enable_compute_isolation: Optional[bool] = False, host_sku: Optional[str] = None, **kwargs ): @@ -1388,6 +1751,8 @@ class ConnectivityEndpoint(msrest.serialization.Model): :type location: str :param port: The port to connect to. :type port: int + :param private_ip_address: The private ip address of the endpoint. + :type private_ip_address: str """ _attribute_map = { @@ -1395,6 +1760,7 @@ class ConnectivityEndpoint(msrest.serialization.Model): 'protocol': {'key': 'protocol', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'port': {'key': 'port', 'type': 'int'}, + 'private_ip_address': {'key': 'privateIPAddress', 'type': 'str'}, } def __init__( @@ -1404,6 +1770,7 @@ def __init__( protocol: Optional[str] = None, location: Optional[str] = None, port: Optional[int] = None, + private_ip_address: Optional[str] = None, **kwargs ): super(ConnectivityEndpoint, self).__init__(**kwargs) @@ -1411,6 +1778,7 @@ def __init__( self.protocol = protocol self.location = location self.port = port + self.private_ip_address = private_ip_address class DataDisksGroups(msrest.serialization.Model): @@ -1449,6 +1817,43 @@ def __init__( self.disk_size_gb = None +class Dimension(msrest.serialization.Model): + """The definition of Dimension. + + :param name: The name of the dimension. + :type name: str + :param display_name: The display name of the dimension. + :type display_name: str + :param internal_name: The display name of the dimension. + :type internal_name: str + :param to_be_exported_for_shoebox: The flag indicates whether the metric will be exported for + shoebox or not. + :type to_be_exported_for_shoebox: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + internal_name: Optional[str] = None, + to_be_exported_for_shoebox: Optional[bool] = None, + **kwargs + ): + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.internal_name = internal_name + self.to_be_exported_for_shoebox = to_be_exported_for_shoebox + + class DiskBillingMeters(msrest.serialization.Model): """The disk billing meters. @@ -1603,6 +2008,32 @@ def __init__( self.message = message +class ExcludedServicesConfig(msrest.serialization.Model): + """The configuration that services will be excluded when creating cluster. + + :param excluded_services_config_id: The config id of excluded services. + :type excluded_services_config_id: str + :param excluded_services_list: The list of excluded services. + :type excluded_services_list: str + """ + + _attribute_map = { + 'excluded_services_config_id': {'key': 'excludedServicesConfigId', 'type': 'str'}, + 'excluded_services_list': {'key': 'excludedServicesList', 'type': 'str'}, + } + + def __init__( + self, + *, + excluded_services_config_id: Optional[str] = None, + excluded_services_list: Optional[str] = None, + **kwargs + ): + super(ExcludedServicesConfig, self).__init__(**kwargs) + self.excluded_services_config_id = excluded_services_config_id + self.excluded_services_list = excluded_services_list + + class ExecuteScriptActionParameters(msrest.serialization.Model): """The parameters for the script actions to execute on a running cluster. @@ -1755,20 +2186,25 @@ class KafkaRestProperties(msrest.serialization.Model): :param client_group_info: The information of AAD security group. :type client_group_info: ~azure.mgmt.hdinsight.models.ClientGroupInfo + :param configuration_override: The configurations that need to be overriden. + :type configuration_override: dict[str, str] """ _attribute_map = { 'client_group_info': {'key': 'clientGroupInfo', 'type': 'ClientGroupInfo'}, + 'configuration_override': {'key': 'configurationOverride', 'type': '{str}'}, } def __init__( self, *, client_group_info: Optional["ClientGroupInfo"] = None, + configuration_override: Optional[Dict[str, str]] = None, **kwargs ): super(KafkaRestProperties, self).__init__(**kwargs) self.client_group_info = client_group_info + self.configuration_override = configuration_override class LinuxOperatingSystemProfile(msrest.serialization.Model): @@ -1828,6 +2264,171 @@ def __init__( self.localized_value = localized_value +class MetricSpecifications(msrest.serialization.Model): + """The details of metric specifications. + + :param name: The name of the metric specification. + :type name: str + :param display_name: The display name of the metric specification. + :type display_name: str + :param display_description: The display description of the metric specification. + :type display_description: str + :param unit: The unit of the metric specification. + :type unit: str + :param aggregation_type: The aggregation type of the metric specification. + :type aggregation_type: str + :param supported_aggregation_types: The supported aggregation types of the metric + specification. + :type supported_aggregation_types: list[str] + :param supported_time_grain_types: The supported time grain types of the metric specification. + :type supported_time_grain_types: list[str] + :param enable_regional_mdm_account: The flag indicates whether enable regional mdm account or + not. + :type enable_regional_mdm_account: bool + :param source_mdm_account: The source mdm account. + :type source_mdm_account: str + :param source_mdm_namespace: The source mdm namespace. + :type source_mdm_namespace: str + :param metric_filter_pattern: The metric filter pattern. + :type metric_filter_pattern: str + :param fill_gap_with_zero: The flag indicates whether filling gap with zero. + :type fill_gap_with_zero: bool + :param category: The category of the metric. + :type category: str + :param resource_id_dimension_name_override: The override name of resource id dimension name. + :type resource_id_dimension_name_override: str + :param is_internal: The flag indicates whether the metric is internal or not. + :type is_internal: bool + :param delegate_metric_name_override: The override name of delegate metric. + :type delegate_metric_name_override: str + :param dimensions: The dimensions of the metric specification. + :type dimensions: list[~azure.mgmt.hdinsight.models.Dimension] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'bool'}, + 'source_mdm_account': {'key': 'sourceMdmAccount', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + 'metric_filter_pattern': {'key': 'metricFilterPattern', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + 'is_internal': {'key': 'isInternal', 'type': 'bool'}, + 'delegate_metric_name_override': {'key': 'delegateMetricNameOverride', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + display_description: Optional[str] = None, + unit: Optional[str] = None, + aggregation_type: Optional[str] = None, + supported_aggregation_types: Optional[List[str]] = None, + supported_time_grain_types: Optional[List[str]] = None, + enable_regional_mdm_account: Optional[bool] = None, + source_mdm_account: Optional[str] = None, + source_mdm_namespace: Optional[str] = None, + metric_filter_pattern: Optional[str] = None, + fill_gap_with_zero: Optional[bool] = None, + category: Optional[str] = None, + resource_id_dimension_name_override: Optional[str] = None, + is_internal: Optional[bool] = None, + delegate_metric_name_override: Optional[str] = None, + dimensions: Optional[List["Dimension"]] = None, + **kwargs + ): + super(MetricSpecifications, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.supported_aggregation_types = supported_aggregation_types + self.supported_time_grain_types = supported_time_grain_types + self.enable_regional_mdm_account = enable_regional_mdm_account + self.source_mdm_account = source_mdm_account + self.source_mdm_namespace = source_mdm_namespace + self.metric_filter_pattern = metric_filter_pattern + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override + self.is_internal = is_internal + self.delegate_metric_name_override = delegate_metric_name_override + self.dimensions = dimensions + + +class NameAvailabilityCheckRequestParameters(msrest.serialization.Model): + """The request spec of checking name availability. + + :param name: The resource name. + :type name: str + :param type: The resource type. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[str] = None, + **kwargs + ): + super(NameAvailabilityCheckRequestParameters, self).__init__(**kwargs) + self.name = name + self.type = type + + +class NameAvailabilityCheckResult(msrest.serialization.Model): + """The response spec of checking name availability. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name_available: This indicates whether the name is available. + :type name_available: bool + :ivar reason: The reason of the result. + :vartype reason: str + :ivar message: The related message. + :vartype message: str + """ + + _validation = { + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + name_available: Optional[bool] = None, + **kwargs + ): + super(NameAvailabilityCheckResult, self).__init__(**kwargs) + self.name_available = name_available + self.reason = None + self.message = None + + class NetworkProperties(msrest.serialization.Model): """The network properties. @@ -1864,11 +2465,14 @@ class Operation(msrest.serialization.Model): :type name: str :param display: The object that represents the operation. :type display: ~azure.mgmt.hdinsight.models.OperationDisplay + :param properties: The operation properties. + :type properties: ~azure.mgmt.hdinsight.models.OperationProperties """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'properties': {'key': 'properties', 'type': 'OperationProperties'}, } def __init__( @@ -1876,11 +2480,13 @@ def __init__( *, name: Optional[str] = None, display: Optional["OperationDisplay"] = None, + properties: Optional["OperationProperties"] = None, **kwargs ): super(Operation, self).__init__(**kwargs) self.name = name self.display = display + self.properties = properties class OperationDisplay(msrest.serialization.Model): @@ -1892,12 +2498,15 @@ class OperationDisplay(msrest.serialization.Model): :type resource: str :param operation: The operation type: read, write, delete, etc. :type operation: str + :param description: Localized friendly description for the operation. + :type description: str """ _attribute_map = { 'provider': {'key': 'provider', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'str'}, 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, } def __init__( @@ -1906,12 +2515,14 @@ def __init__( 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 self.operation = operation + self.description = description class OperationListResult(msrest.serialization.Model): @@ -1940,31 +2551,25 @@ def __init__( self.next_link = next_link -class OperationResource(msrest.serialization.Model): - """The azure async operation response. +class OperationProperties(msrest.serialization.Model): + """The details of operation. - :param status: The async operation state. Possible values include: "InProgress", "Succeeded", - "Failed". - :type status: str or ~azure.mgmt.hdinsight.models.AsyncOperationState - :param error: The operation error information. - :type error: ~azure.mgmt.hdinsight.models.Errors + :param service_specification: The specification of the service. + :type service_specification: ~azure.mgmt.hdinsight.models.ServiceSpecification """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'Errors'}, + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, } def __init__( self, *, - status: Optional[Union[str, "AsyncOperationState"]] = None, - error: Optional["Errors"] = None, + service_specification: Optional["ServiceSpecification"] = None, **kwargs ): - super(OperationResource, self).__init__(**kwargs) - self.status = status - self.error = error + super(OperationProperties, self).__init__(**kwargs) + self.service_specification = service_specification class OsProfile(msrest.serialization.Model): @@ -1988,38 +2593,6 @@ def __init__( self.linux_operating_system_profile = linux_operating_system_profile -class ProxyResource(Resource): - """The resource model definition for a ARM proxy resource. It will have everything other than required location and tags. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource Id for the resource. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProxyResource, self).__init__(**kwargs) - - class QuotaCapability(msrest.serialization.Model): """The regional quota capability. @@ -2133,6 +2706,8 @@ class Role(msrest.serialization.Model): :type min_instance_count: int :param target_instance_count: The instance count of the cluster. :type target_instance_count: int + :param vm_group_name: The name of the virtual machine group. + :type vm_group_name: str :param autoscale_configuration: The autoscale configurations. :type autoscale_configuration: ~azure.mgmt.hdinsight.models.Autoscale :param hardware_profile: The hardware profile. @@ -2145,18 +2720,22 @@ class Role(msrest.serialization.Model): :type data_disks_groups: list[~azure.mgmt.hdinsight.models.DataDisksGroups] :param script_actions: The list of script actions on the role. :type script_actions: list[~azure.mgmt.hdinsight.models.ScriptAction] + :param encrypt_data_disks: Indicates whether encrypt the data disks. + :type encrypt_data_disks: bool """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'min_instance_count': {'key': 'minInstanceCount', 'type': 'int'}, 'target_instance_count': {'key': 'targetInstanceCount', 'type': 'int'}, + 'vm_group_name': {'key': 'VMGroupName', 'type': 'str'}, 'autoscale_configuration': {'key': 'autoscale', 'type': 'Autoscale'}, 'hardware_profile': {'key': 'hardwareProfile', 'type': 'HardwareProfile'}, 'os_profile': {'key': 'osProfile', 'type': 'OsProfile'}, 'virtual_network_profile': {'key': 'virtualNetworkProfile', 'type': 'VirtualNetworkProfile'}, 'data_disks_groups': {'key': 'dataDisksGroups', 'type': '[DataDisksGroups]'}, 'script_actions': {'key': 'scriptActions', 'type': '[ScriptAction]'}, + 'encrypt_data_disks': {'key': 'encryptDataDisks', 'type': 'bool'}, } def __init__( @@ -2165,24 +2744,28 @@ def __init__( name: Optional[str] = None, min_instance_count: Optional[int] = None, target_instance_count: Optional[int] = None, + vm_group_name: Optional[str] = None, autoscale_configuration: Optional["Autoscale"] = None, hardware_profile: Optional["HardwareProfile"] = None, os_profile: Optional["OsProfile"] = None, virtual_network_profile: Optional["VirtualNetworkProfile"] = None, data_disks_groups: Optional[List["DataDisksGroups"]] = None, script_actions: Optional[List["ScriptAction"]] = None, + encrypt_data_disks: Optional[bool] = False, **kwargs ): super(Role, self).__init__(**kwargs) self.name = name self.min_instance_count = min_instance_count self.target_instance_count = target_instance_count + self.vm_group_name = vm_group_name self.autoscale_configuration = autoscale_configuration self.hardware_profile = hardware_profile self.os_profile = os_profile self.virtual_network_profile = virtual_network_profile self.data_disks_groups = data_disks_groups self.script_actions = script_actions + self.encrypt_data_disks = encrypt_data_disks class RuntimeScriptAction(msrest.serialization.Model): @@ -2510,8 +3093,8 @@ class SecurityProfile(msrest.serialization.Model): :type cluster_users_group_d_ns: list[str] :param aadds_resource_id: The resource ID of the user's Azure Active Directory Domain Service. :type aadds_resource_id: str - :param msi_resource_id: User assigned identity that has permissions to read and create cluster- - related artifacts in the user's AADDS. + :param msi_resource_id: User assigned identity that has permissions to read and create + cluster-related artifacts in the user's AADDS. :type msi_resource_id: str """ @@ -2557,6 +3140,27 @@ def __init__( self.msi_resource_id = msi_resource_id +class ServiceSpecification(msrest.serialization.Model): + """The specification of the service. + + :param metric_specifications: The metric specifications. + :type metric_specifications: list[~azure.mgmt.hdinsight.models.MetricSpecifications] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecifications]'}, + } + + def __init__( + self, + *, + metric_specifications: Optional[List["MetricSpecifications"]] = None, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + class SshProfile(msrest.serialization.Model): """The list of SSH public keys. @@ -2619,6 +3223,10 @@ class StorageAccount(msrest.serialization.Model): :param msi_resource_id: The managed identity (MSI) that is allowed to access the storage account, only to be specified for Azure Data Lake Storage Gen 2. :type msi_resource_id: str + :param saskey: The shared access signature key. + :type saskey: str + :param fileshare: The file share name. + :type fileshare: str """ _attribute_map = { @@ -2629,6 +3237,8 @@ class StorageAccount(msrest.serialization.Model): 'key': {'key': 'key', 'type': 'str'}, 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'msi_resource_id': {'key': 'msiResourceId', 'type': 'str'}, + 'saskey': {'key': 'saskey', 'type': 'str'}, + 'fileshare': {'key': 'fileshare', 'type': 'str'}, } def __init__( @@ -2641,6 +3251,8 @@ def __init__( key: Optional[str] = None, resource_id: Optional[str] = None, msi_resource_id: Optional[str] = None, + saskey: Optional[str] = None, + fileshare: Optional[str] = None, **kwargs ): super(StorageAccount, self).__init__(**kwargs) @@ -2651,6 +3263,8 @@ def __init__( self.key = key self.resource_id = resource_id self.msi_resource_id = msi_resource_id + self.saskey = saskey + self.fileshare = fileshare class StorageProfile(msrest.serialization.Model): @@ -2674,6 +3288,37 @@ def __init__( self.storageaccounts = storageaccounts +class UpdateClusterIdentityCertificateParameters(msrest.serialization.Model): + """The update cluster identity certificate request parameters. + + :param application_id: The application id. + :type application_id: str + :param certificate: The certificate in base64 encoded format. + :type certificate: str + :param certificate_password: The password of the certificate. + :type certificate_password: str + """ + + _attribute_map = { + 'application_id': {'key': 'applicationId', 'type': 'str'}, + 'certificate': {'key': 'certificate', 'type': 'str'}, + 'certificate_password': {'key': 'certificatePassword', 'type': 'str'}, + } + + def __init__( + self, + *, + application_id: Optional[str] = None, + certificate: Optional[str] = None, + certificate_password: Optional[str] = None, + **kwargs + ): + super(UpdateClusterIdentityCertificateParameters, self).__init__(**kwargs) + self.application_id = application_id + self.certificate = certificate + self.certificate_password = certificate_password + + class UpdateGatewaySettingsParameters(msrest.serialization.Model): """The update gateway settings request parameters. @@ -2714,9 +3359,9 @@ class Usage(msrest.serialization.Model): :param unit: The type of measurement for usage. :type unit: str :param current_value: The current usage. - :type current_value: int + :type current_value: long :param limit: The maximum allowed usage. - :type limit: int + :type limit: long :ivar name: The details about the localizable name of the used resource. :vartype name: ~azure.mgmt.hdinsight.models.LocalizedName """ @@ -2727,8 +3372,8 @@ class Usage(msrest.serialization.Model): _attribute_map = { 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, 'name': {'key': 'name', 'type': 'LocalizedName'}, } @@ -2768,6 +3413,42 @@ def __init__( self.value = value +class ValidationErrorInfo(msrest.serialization.Model): + """The validation error information. + + :param code: The error code. + :type code: str + :param message: The error message. + :type message: str + :param error_resource: The error resource. + :type error_resource: str + :param message_arguments: The message arguments. + :type message_arguments: list[str] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'error_resource': {'key': 'errorResource', 'type': 'str'}, + 'message_arguments': {'key': 'messageArguments', 'type': '[str]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + error_resource: Optional[str] = None, + message_arguments: Optional[List[str]] = None, + **kwargs + ): + super(ValidationErrorInfo, self).__init__(**kwargs) + self.code = code + self.message = message + self.error_resource = error_resource + self.message_arguments = message_arguments + + class VersionsCapability(msrest.serialization.Model): """The version capability. @@ -2797,7 +3478,7 @@ class VersionSpec(msrest.serialization.Model): :param display_name: The display name. :type display_name: str :param is_default: Whether or not the version is the default version. - :type is_default: str + :type is_default: bool :param component_versions: The component version property. :type component_versions: dict[str, str] """ @@ -2805,7 +3486,7 @@ class VersionSpec(msrest.serialization.Model): _attribute_map = { 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, 'component_versions': {'key': 'componentVersions', 'type': '{str}'}, } @@ -2814,7 +3495,7 @@ def __init__( *, friendly_name: Optional[str] = None, display_name: Optional[str] = None, - is_default: Optional[str] = None, + is_default: Optional[bool] = None, component_versions: Optional[Dict[str, str]] = None, **kwargs ): @@ -2864,8 +3545,16 @@ class VmSizeCompatibilityFilter(msrest.serialization.Model): :type node_types: list[str] :param cluster_versions: The list of cluster versions. :type cluster_versions: list[str] - :param vmsizes: The list of virtual machine sizes. - :type vmsizes: list[str] + :param os_type: The list of OS types. + :type os_type: list[str] + :param vm_sizes: The list of virtual machine sizes. + :type vm_sizes: list[str] + :param esp_applied: Whether apply for ESP cluster. 'true' means only for ESP, 'false' means + only for non-ESP, null or empty string or others mean for both. + :type esp_applied: str + :param compute_isolation_supported: Whether support compute isolation. 'true' means only for + ComputeIsolationEnabled, 'false' means only for regular cluster. + :type compute_isolation_supported: str """ _attribute_map = { @@ -2874,7 +3563,10 @@ class VmSizeCompatibilityFilter(msrest.serialization.Model): 'cluster_flavors': {'key': 'ClusterFlavors', 'type': '[str]'}, 'node_types': {'key': 'NodeTypes', 'type': '[str]'}, 'cluster_versions': {'key': 'ClusterVersions', 'type': '[str]'}, - 'vmsizes': {'key': 'vmsizes', 'type': '[str]'}, + 'os_type': {'key': 'OsType', 'type': '[str]'}, + 'vm_sizes': {'key': 'VMSizes', 'type': '[str]'}, + 'esp_applied': {'key': 'ESPApplied', 'type': 'str'}, + 'compute_isolation_supported': {'key': 'ComputeIsolationSupported', 'type': 'str'}, } def __init__( @@ -2885,7 +3577,10 @@ def __init__( cluster_flavors: Optional[List[str]] = None, node_types: Optional[List[str]] = None, cluster_versions: Optional[List[str]] = None, - vmsizes: Optional[List[str]] = None, + os_type: Optional[List[str]] = None, + vm_sizes: Optional[List[str]] = None, + esp_applied: Optional[str] = None, + compute_isolation_supported: Optional[str] = None, **kwargs ): super(VmSizeCompatibilityFilter, self).__init__(**kwargs) @@ -2894,14 +3589,17 @@ def __init__( self.cluster_flavors = cluster_flavors self.node_types = node_types self.cluster_versions = cluster_versions - self.vmsizes = vmsizes + self.os_type = os_type + self.vm_sizes = vm_sizes + self.esp_applied = esp_applied + self.compute_isolation_supported = compute_isolation_supported class VmSizeCompatibilityFilterV2(msrest.serialization.Model): """This class represent a single filter object that defines a multidimensional set. The dimensions of this set are Regions, ClusterFlavors, NodeTypes and ClusterVersions. The constraint should be defined based on the following: FilterMode (Exclude vs Include), VMSizes (the vm sizes in affect of exclusion/inclusion) and the ordering of the Filters. Later filters override previous settings if conflicted. :param filter_mode: The filtering mode. Effectively this can enabling or disabling the VM sizes - in a particular set. Possible values include: "Exclude", "Include". + in a particular set. Possible values include: "Exclude", "Include", "Recommend", "Default". :type filter_mode: str or ~azure.mgmt.hdinsight.models.FilterMode :param regions: The list of regions under the effect of the filter. :type regions: list[str] @@ -2949,6 +3647,76 @@ def __init__( self.vm_sizes = vm_sizes +class VmSizeProperty(msrest.serialization.Model): + """The vm size property. + + :param name: The vm size name. + :type name: str + :param cores: The number of cores that the vm size has. + :type cores: int + :param data_disk_storage_tier: The data disk storage tier of the vm size. + :type data_disk_storage_tier: str + :param label: The label of the vm size. + :type label: str + :param max_data_disk_count: The max data disk count of the vm size. + :type max_data_disk_count: long + :param memory_in_mb: The memory whose unit is MB of the vm size. + :type memory_in_mb: long + :param supported_by_virtual_machines: This indicates this vm size is supported by virtual + machines or not. + :type supported_by_virtual_machines: bool + :param supported_by_web_worker_roles: The indicates this vm size is supported by web worker + roles or not. + :type supported_by_web_worker_roles: bool + :param virtual_machine_resource_disk_size_in_mb: The virtual machine resource disk size whose + unit is MB of the vm size. + :type virtual_machine_resource_disk_size_in_mb: long + :param web_worker_resource_disk_size_in_mb: The web worker resource disk size whose unit is MB + of the vm size. + :type web_worker_resource_disk_size_in_mb: long + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'cores': {'key': 'cores', 'type': 'int'}, + 'data_disk_storage_tier': {'key': 'dataDiskStorageTier', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'max_data_disk_count': {'key': 'maxDataDiskCount', 'type': 'long'}, + 'memory_in_mb': {'key': 'memoryInMb', 'type': 'long'}, + 'supported_by_virtual_machines': {'key': 'supportedByVirtualMachines', 'type': 'bool'}, + 'supported_by_web_worker_roles': {'key': 'supportedByWebWorkerRoles', 'type': 'bool'}, + 'virtual_machine_resource_disk_size_in_mb': {'key': 'virtualMachineResourceDiskSizeInMb', 'type': 'long'}, + 'web_worker_resource_disk_size_in_mb': {'key': 'webWorkerResourceDiskSizeInMb', 'type': 'long'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + cores: Optional[int] = None, + data_disk_storage_tier: Optional[str] = None, + label: Optional[str] = None, + max_data_disk_count: Optional[int] = None, + memory_in_mb: Optional[int] = None, + supported_by_virtual_machines: Optional[bool] = None, + supported_by_web_worker_roles: Optional[bool] = None, + virtual_machine_resource_disk_size_in_mb: Optional[int] = None, + web_worker_resource_disk_size_in_mb: Optional[int] = None, + **kwargs + ): + super(VmSizeProperty, self).__init__(**kwargs) + self.name = name + self.cores = cores + self.data_disk_storage_tier = data_disk_storage_tier + self.label = label + self.max_data_disk_count = max_data_disk_count + self.memory_in_mb = memory_in_mb + self.supported_by_virtual_machines = supported_by_virtual_machines + self.supported_by_web_worker_roles = supported_by_web_worker_roles + self.virtual_machine_resource_disk_size_in_mb = virtual_machine_resource_disk_size_in_mb + self.web_worker_resource_disk_size_in_mb = web_worker_resource_disk_size_in_mb + + class VmSizesCapability(msrest.serialization.Model): """The virtual machine sizes capability. diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_applications_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_applications_operations.py index 75fd0bb1573a..c6d21dfbc004 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_applications_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_applications_operations.py @@ -112,7 +112,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) @@ -176,7 +176,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('Application', pipeline_response) @@ -233,7 +233,7 @@ def _create_initial( 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('Application', pipeline_response) @@ -265,8 +265,8 @@ def begin_create( :type parameters: ~azure.mgmt.hdinsight.models.Application :keyword callable cls: A custom type or function 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either Application or the result of cls(response) @@ -307,7 +307,7 @@ def get_long_running_output(pipeline_response): 'applicationName': self._serialize.url("application_name", application_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,9 +359,9 @@ def _delete_initial( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 202]: + 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: @@ -387,8 +387,8 @@ def begin_delete( :type application_name: str :keyword callable cls: A custom type or function 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: 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) @@ -425,7 +425,7 @@ def get_long_running_output(pipeline_response): 'applicationName': self._serialize.url("application_name", application_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -438,3 +438,71 @@ def get_long_running_output(pipeline_response): else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}'} # type: ignore + + def get_azure_async_operation_status( + self, + resource_group_name, # type: str + cluster_name, # type: str + application_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AsyncOperationResult" + """Gets the async operation status. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param application_name: The constant value for the application name. + :type application_name: str + :param operation_id: The long running operation id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AsyncOperationResult, or the result of cls(response) + :rtype: ~azure.mgmt.hdinsight.models.AsyncOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AsyncOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_azure_async_operation_status.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'applicationName': self._serialize.url("application_name", application_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_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['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.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AsyncOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_azure_async_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}/azureasyncoperations/{operationId}'} # type: ignore diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_clusters_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_clusters_operations.py index 172ed195a01b..922ff715287a 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_clusters_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_clusters_operations.py @@ -91,7 +91,7 @@ def _create_initial( 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('Cluster', pipeline_response) @@ -120,8 +120,8 @@ def begin_create( :type parameters: ~azure.mgmt.hdinsight.models.ClusterCreateParametersExtended :keyword callable cls: A custom type or function 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either Cluster or the result of cls(response) @@ -160,7 +160,7 @@ def get_long_running_output(pipeline_response): 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -231,7 +231,7 @@ def update( 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('Cluster', pipeline_response) @@ -278,9 +278,9 @@ def _delete_initial( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 202]: + 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: @@ -303,8 +303,8 @@ def begin_delete( :type cluster_name: str :keyword callable cls: A custom type or function 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: 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) @@ -339,7 +339,7 @@ def get_long_running_output(pipeline_response): 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -402,7 +402,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('Cluster', pipeline_response) @@ -474,7 +474,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) @@ -531,7 +531,7 @@ def _resize_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) if cls: @@ -560,8 +560,8 @@ def begin_resize( :type parameters: ~azure.mgmt.hdinsight.models.ClusterResizeParameters :keyword callable cls: A custom type or function 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: 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) @@ -599,7 +599,7 @@ def get_long_running_output(pipeline_response): 'roleName': self._serialize.url("role_name", role_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -659,7 +659,7 @@ def _update_auto_scale_configuration_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) if cls: @@ -688,8 +688,8 @@ def begin_update_auto_scale_configuration( :type parameters: ~azure.mgmt.hdinsight.models.AutoscaleConfigurationUpdateParameter :keyword callable cls: A custom type or function 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: 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) @@ -727,7 +727,7 @@ def get_long_running_output(pipeline_response): 'roleName': self._serialize.url("role_name", role_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -798,7 +798,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) @@ -853,7 +853,7 @@ def _rotate_disk_encryption_key_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) if cls: @@ -879,8 +879,8 @@ def begin_rotate_disk_encryption_key( :type parameters: ~azure.mgmt.hdinsight.models.ClusterDiskEncryptionParameters :keyword callable cls: A custom type or function 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: 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) @@ -916,7 +916,7 @@ def get_long_running_output(pipeline_response): 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -979,7 +979,7 @@ def get_gateway_settings( 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('GatewaySettings', pipeline_response) @@ -1034,7 +1034,7 @@ def _update_gateway_settings_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) if cls: @@ -1060,8 +1060,8 @@ def begin_update_gateway_settings( :type parameters: ~azure.mgmt.hdinsight.models.UpdateGatewaySettingsParameters :keyword callable cls: A custom type or function 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: 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) @@ -1097,7 +1097,7 @@ def get_long_running_output(pipeline_response): 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1111,6 +1111,191 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_update_gateway_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/updateGatewaySettings'} # type: ignore + def get_azure_async_operation_status( + self, + resource_group_name, # type: str + cluster_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AsyncOperationResult" + """The the async operation status. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param operation_id: The long running operation id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AsyncOperationResult, or the result of cls(response) + :rtype: ~azure.mgmt.hdinsight.models.AsyncOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AsyncOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_azure_async_operation_status.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_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['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.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AsyncOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_azure_async_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/azureasyncoperations/{operationId}'} # type: ignore + + def _update_identity_certificate_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + parameters, # type: "_models.UpdateClusterIdentityCertificateParameters" + **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 = "2018-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_identity_certificate_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'), + 'clusterName': self._serialize.url("cluster_name", cluster_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, 'UpdateClusterIdentityCertificateParameters') + 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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _update_identity_certificate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/updateClusterIdentityCertificate'} # type: ignore + + def begin_update_identity_certificate( + self, + resource_group_name, # type: str + cluster_name, # type: str + parameters, # type: "_models.UpdateClusterIdentityCertificateParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Updates the cluster identity certificate. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param parameters: The cluster configurations. + :type parameters: ~azure.mgmt.hdinsight.models.UpdateClusterIdentityCertificateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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._update_identity_certificate_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_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): + if cls: + return cls(pipeline_response, None, {}) + + 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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if 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_identity_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/updateClusterIdentityCertificate'} # type: ignore + def _execute_script_actions_initial( self, resource_group_name, # type: str @@ -1153,9 +1338,9 @@ def _execute_script_actions_initial( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 202, 404]: 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: @@ -1181,8 +1366,8 @@ def begin_execute_script_actions( :type parameters: ~azure.mgmt.hdinsight.models.ExecuteScriptActionParameters :keyword callable cls: A custom type or function 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: 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) @@ -1218,7 +1403,7 @@ def get_long_running_output(pipeline_response): 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_configurations_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_configurations_operations.py index c530a9983da8..8efe550da0d6 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_configurations_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_configurations_operations.py @@ -95,7 +95,7 @@ def list( 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('ClusterConfigurations', pipeline_response) @@ -152,7 +152,7 @@ def _update_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: @@ -182,8 +182,8 @@ def begin_update( :type parameters: dict[str, str] :keyword callable cls: A custom type or function 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: 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) @@ -221,7 +221,7 @@ def get_long_running_output(pipeline_response): 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -289,7 +289,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('{str}', pipeline_response) diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_extensions_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_extensions_operations.py index 5d9a3082cd24..1209a3be2648 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_extensions_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_extensions_operations.py @@ -90,7 +90,7 @@ def _enable_monitoring_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) if cls: @@ -116,8 +116,8 @@ def begin_enable_monitoring( :type parameters: ~azure.mgmt.hdinsight.models.ClusterMonitoringRequest :keyword callable cls: A custom type or function 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: 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) @@ -153,7 +153,7 @@ def get_long_running_output(pipeline_response): 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -216,7 +216,7 @@ def get_monitoring_status( 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('ClusterMonitoringResponse', pipeline_response) @@ -263,9 +263,9 @@ def _disable_monitoring_initial( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 202]: + 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: @@ -288,8 +288,8 @@ def begin_disable_monitoring( :type cluster_name: str :keyword callable cls: A custom type or function 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: 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) @@ -324,7 +324,7 @@ def get_long_running_output(pipeline_response): 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,6 +338,298 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_disable_monitoring.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring'} # type: ignore + def _enable_azure_monitor_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + parameters, # type: "_models.AzureMonitorRequest" + **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 = "2018-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._enable_azure_monitor_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'), + 'clusterName': self._serialize.url("cluster_name", cluster_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, 'AzureMonitorRequest') + 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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _enable_azure_monitor_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitor'} # type: ignore + + def begin_enable_azure_monitor( + self, + resource_group_name, # type: str + cluster_name, # type: str + parameters, # type: "_models.AzureMonitorRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Enables the Azure Monitor on the HDInsight cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param parameters: The Log Analytics workspace parameters. + :type parameters: ~azure.mgmt.hdinsight.models.AzureMonitorRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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._enable_azure_monitor_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_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): + if cls: + return cls(pipeline_response, None, {}) + + 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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if 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_enable_azure_monitor.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitor'} # type: ignore + + def get_azure_monitor_status( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AzureMonitorResponse" + """Gets the status of Azure Monitor on the HDInsight cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureMonitorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.hdinsight.models.AzureMonitorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureMonitorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_azure_monitor_status.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_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.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureMonitorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_azure_monitor_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitor'} # type: ignore + + def _disable_azure_monitor_initial( + self, + resource_group_name, # type: str + cluster_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 = "2018-06-01-preview" + accept = "application/json" + + # Construct URL + url = self._disable_azure_monitor_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'), + 'clusterName': self._serialize.url("cluster_name", cluster_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.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _disable_azure_monitor_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitor'} # type: ignore + + def begin_disable_azure_monitor( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Disables the Azure Monitor on the HDInsight cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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._disable_azure_monitor_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_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, {}) + + 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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if 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_disable_azure_monitor.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitor'} # type: ignore + def _create_initial( self, resource_group_name, # type: str @@ -384,7 +676,7 @@ def _create_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) if cls: @@ -413,8 +705,8 @@ def begin_create( :type parameters: ~azure.mgmt.hdinsight.models.Extension :keyword callable cls: A custom type or function 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: 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) @@ -452,7 +744,7 @@ def get_long_running_output(pipeline_response): 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -473,7 +765,7 @@ def get( extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> "_models.Extension" + # type: (...) -> "_models.ClusterMonitoringResponse" """Gets the extension properties for the specified HDInsight cluster extension. :param resource_group_name: The name of the resource group. @@ -483,11 +775,11 @@ def get( :param extension_name: The name of the cluster extension. :type extension_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Extension, or the result of cls(response) - :rtype: ~azure.mgmt.hdinsight.models.Extension + :return: ClusterMonitoringResponse, or the result of cls(response) + :rtype: ~azure.mgmt.hdinsight.models.ClusterMonitoringResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterMonitoringResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,10 +811,10 @@ 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('Extension', pipeline_response) + deserialized = self._deserialize('ClusterMonitoringResponse', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -568,9 +860,9 @@ def _delete_initial( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 202]: + 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: @@ -596,8 +888,8 @@ def begin_delete( :type extension_name: str :keyword callable cls: A custom type or function 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: 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) @@ -634,7 +926,7 @@ def get_long_running_output(pipeline_response): 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -647,3 +939,71 @@ def get_long_running_output(pipeline_response): else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}'} # type: ignore + + def get_azure_async_operation_status( + self, + resource_group_name, # type: str + cluster_name, # type: str + extension_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AsyncOperationResult" + """Gets the async operation status. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param extension_name: The name of the cluster extension. + :type extension_name: str + :param operation_id: The long running operation id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AsyncOperationResult, or the result of cls(response) + :rtype: ~azure.mgmt.hdinsight.models.AsyncOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AsyncOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_azure_async_operation_status.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_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['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.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AsyncOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_azure_async_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}/azureAsyncOperations/{operationId}'} # type: ignore diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_locations_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_locations_operations.py index 186e9d1517e9..0706f04ebc04 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_locations_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_locations_operations.py @@ -89,7 +89,7 @@ def get_capabilities( 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('CapabilitiesResult', pipeline_response) @@ -145,7 +145,7 @@ def list_usages( 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('UsagesListResult', pipeline_response) @@ -201,7 +201,7 @@ def list_billing_specs( 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('BillingResponseListResult', pipeline_response) @@ -211,3 +211,191 @@ def list_billing_specs( return deserialized list_billing_specs.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/billingSpecs'} # type: ignore + + def get_azure_async_operation_status( + self, + location, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AsyncOperationResult" + """Get the async operation status. + + :param location: The Azure location (region) for which to make the request. + :type location: str + :param operation_id: The long running operation id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AsyncOperationResult, or the result of cls(response) + :rtype: ~azure.mgmt.hdinsight.models.AsyncOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AsyncOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_azure_async_operation_status.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'), + 'operationId': self._serialize.url("operation_id", operation_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['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.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AsyncOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_azure_async_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/azureasyncoperations/{operationId}'} # type: ignore + + def check_name_availability( + self, + location, # type: str + parameters, # type: "_models.NameAvailabilityCheckRequestParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.NameAvailabilityCheckResult" + """Check the cluster name is available or not. + + :param location: The Azure location (region) for which to make the request. + :type location: str + :param parameters: + :type parameters: ~azure.mgmt.hdinsight.models.NameAvailabilityCheckRequestParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NameAvailabilityCheckResult, or the result of cls(response) + :rtype: ~azure.mgmt.hdinsight.models.NameAvailabilityCheckResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NameAvailabilityCheckResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.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'), + } + 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, 'NameAvailabilityCheckRequestParameters') + 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.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NameAvailabilityCheckResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/checkNameAvailability'} # type: ignore + + def validate_cluster_create_request( + self, + location, # type: str + parameters, # type: "_models.ClusterCreateRequestValidationParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.ClusterCreateValidationResult" + """Validate the cluster create request spec is valid or not. + + :param location: The Azure location (region) for which to make the request. + :type location: str + :param parameters: + :type parameters: ~azure.mgmt.hdinsight.models.ClusterCreateRequestValidationParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ClusterCreateValidationResult, or the result of cls(response) + :rtype: ~azure.mgmt.hdinsight.models.ClusterCreateValidationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterCreateValidationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_cluster_create_request.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'), + } + 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, 'ClusterCreateRequestValidationParameters') + 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.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ClusterCreateValidationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate_cluster_create_request.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/validateCreateRequest'} # type: ignore diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_operations.py index 89d747a09ec5..539308afe21b 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_operations.py @@ -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/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_script_actions_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_script_actions_operations.py index 9112d31c1193..365e8f750812 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_script_actions_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_script_actions_operations.py @@ -96,9 +96,9 @@ def delete( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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) if cls: @@ -171,7 +171,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) @@ -235,7 +235,7 @@ def get_execution_detail( 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('RuntimeScriptActionDetail', pipeline_response) @@ -245,3 +245,67 @@ def get_execution_detail( return deserialized get_execution_detail.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}'} # type: ignore + + def get_execution_async_operation_status( + self, + resource_group_name, # type: str + cluster_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AsyncOperationResult" + """Gets the async operation status of execution operation. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param operation_id: The long running operation id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AsyncOperationResult, or the result of cls(response) + :rtype: ~azure.mgmt.hdinsight.models.AsyncOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AsyncOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_execution_async_operation_status.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_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['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.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AsyncOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_execution_async_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/executeScriptActions/azureasyncoperations/{operationId}'} # type: ignore diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_script_execution_history_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_script_execution_history_operations.py index cff559884901..97e000808f6d 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_script_execution_history_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_script_execution_history_operations.py @@ -110,7 +110,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) @@ -174,7 +174,7 @@ def promote( 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) if cls: diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_virtual_machines_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_virtual_machines_operations.py index eacceb7fa92f..5389c362ed93 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_virtual_machines_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_virtual_machines_operations.py @@ -95,7 +95,7 @@ def list_hosts( 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('[HostInfo]', pipeline_response) @@ -150,7 +150,7 @@ def _restart_hosts_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) if cls: @@ -176,8 +176,8 @@ def begin_restart_hosts( :type hosts: list[str] :keyword callable cls: A custom type or function 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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: 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) @@ -213,7 +213,7 @@ def get_long_running_output(pipeline_response): 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -226,3 +226,67 @@ def get_long_running_output(pipeline_response): else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_restart_hosts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/restartHosts'} # type: ignore + + def get_async_operation_status( + self, + resource_group_name, # type: str + cluster_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AsyncOperationResult" + """Gets the async operation status. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param operation_id: The long running operation id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AsyncOperationResult, or the result of cls(response) + :rtype: ~azure.mgmt.hdinsight.models.AsyncOperationResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AsyncOperationResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_async_operation_status.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_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['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.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AsyncOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_async_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/restartHosts/azureasyncoperations/{operationId}'} # type: ignore