diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/_meta.json b/sdk/azurestackhci/azure-mgmt-azurestackhci/_meta.json index 2608d20f5db2..01faf1eb8365 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/_meta.json +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/_meta.json @@ -1,11 +1,11 @@ { "autorest": "3.4.2", "use": [ - "@autorest/python@5.8.0", - "@autorest/modelerfour@4.19.1" + "@autorest/python@5.8.1", + "@autorest/modelerfour@4.19.2" ], - "commit": "54692d5a0346c6040f14f5c836eaca598009c52d", + "commit": "01ce30325e508d42667080fc6ad1f797df921c2f", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/azurestackhci/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.1 --version=3.4.2", + "autorest_command": "autorest specification/azurestackhci/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.1 --use=@autorest/modelerfour@4.19.2 --version=3.4.2", "readme": "specification/azurestackhci/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_azure_stack_hci_client.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_azure_stack_hci_client.py index a3abb0e8dacb..d23a9ffe6141 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_azure_stack_hci_client.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_azure_stack_hci_client.py @@ -19,23 +19,30 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import AzureStackHCIClientConfiguration -from .operations import Operations +from .operations import ArcSettingsOperations from .operations import ClustersOperations +from .operations import ExtensionsOperations +from .operations import Operations from . import models class AzureStackHCIClient(object): """Azure Stack HCI management service. - :ivar operations: Operations operations - :vartype operations: azure_stack_hci_client.operations.Operations + :ivar arc_settings: ArcSettingsOperations operations + :vartype arc_settings: azure_stack_hci_client.operations.ArcSettingsOperations :ivar clusters: ClustersOperations operations :vartype clusters: azure_stack_hci_client.operations.ClustersOperations + :ivar extensions: ExtensionsOperations operations + :vartype extensions: azure_stack_hci_client.operations.ExtensionsOperations + :ivar operations: Operations operations + :vartype operations: azure_stack_hci_client.operations.Operations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -56,10 +63,14 @@ def __init__( self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) - self.operations = Operations( + self.arc_settings = ArcSettingsOperations( self._client, self._config, self._serialize, self._deserialize) self.clusters = ClustersOperations( self._client, self._config, self._serialize, self._deserialize) + self.extensions = ExtensionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) def _send_request(self, http_request, **kwargs): # type: (HttpRequest, Any) -> HttpResponse diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_configuration.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_configuration.py index b419fc134f8d..7bf8e4c73e83 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_configuration.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_configuration.py @@ -48,7 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-10-01" + self.api_version = "2021-01-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-azurestackhci/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_metadata.json b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_metadata.json index 9fcc7f9c4989..b1bed7064c61 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_metadata.json +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_metadata.json @@ -1,6 +1,6 @@ { - "chosen_version": "2020-10-01", - "total_api_version_list": ["2020-10-01"], + "chosen_version": "2021-01-01-preview", + "total_api_version_list": ["2021-01-01-preview"], "client": { "name": "AzureStackHCIClient", "filename": "_azure_stack_hci_client", @@ -8,7 +8,7 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false, + "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\": [\"AzureStackHCIClientConfiguration\"]}}, \"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\": [\"AzureStackHCIClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" @@ -98,7 +98,9 @@ "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": { - "operations": "Operations", - "clusters": "ClustersOperations" + "arc_settings": "ArcSettingsOperations", + "clusters": "ClustersOperations", + "extensions": "ExtensionsOperations", + "operations": "Operations" } } \ No newline at end of file diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_version.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_version.py index caf312bd2d0b..e5754a47ce68 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_version.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "6.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_azure_stack_hci_client.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_azure_stack_hci_client.py index ac5ac19718e4..4eff22044a77 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_azure_stack_hci_client.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_azure_stack_hci_client.py @@ -17,23 +17,30 @@ from azure.core.credentials_async import AsyncTokenCredential from ._configuration import AzureStackHCIClientConfiguration -from .operations import Operations +from .operations import ArcSettingsOperations from .operations import ClustersOperations +from .operations import ExtensionsOperations +from .operations import Operations from .. import models class AzureStackHCIClient(object): """Azure Stack HCI management service. - :ivar operations: Operations operations - :vartype operations: azure_stack_hci_client.aio.operations.Operations + :ivar arc_settings: ArcSettingsOperations operations + :vartype arc_settings: azure_stack_hci_client.aio.operations.ArcSettingsOperations :ivar clusters: ClustersOperations operations :vartype clusters: azure_stack_hci_client.aio.operations.ClustersOperations + :ivar extensions: ExtensionsOperations operations + :vartype extensions: azure_stack_hci_client.aio.operations.ExtensionsOperations + :ivar operations: Operations operations + :vartype operations: azure_stack_hci_client.aio.operations.Operations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -53,10 +60,14 @@ def __init__( self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) - self.operations = Operations( + self.arc_settings = ArcSettingsOperations( self._client, self._config, self._serialize, self._deserialize) self.clusters = ClustersOperations( self._client, self._config, self._serialize, self._deserialize) + self.extensions = ExtensionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + 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. diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_configuration.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_configuration.py index a9bcc0a1a137..d5dc0073a910 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_configuration.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_configuration.py @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-10-01" + self.api_version = "2021-01-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-azurestackhci/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/__init__.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/__init__.py index b0a4c9469927..d3211472e48c 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/__init__.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/__init__.py @@ -6,10 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._operations import Operations +from ._arc_settings_operations import ArcSettingsOperations from ._clusters_operations import ClustersOperations +from ._extensions_operations import ExtensionsOperations +from ._operations import Operations __all__ = [ - 'Operations', + 'ArcSettingsOperations', 'ClustersOperations', + 'ExtensionsOperations', + 'Operations', ] diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_arc_settings_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_arc_settings_operations.py new file mode 100644 index 000000000000..9c62aa2d29f4 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_arc_settings_operations.py @@ -0,0 +1,372 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ArcSettingsOperations: + """ArcSettingsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_stack_hci_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_cluster( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ArcSettingList"]: + """Get ArcSetting resources of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :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: An iterator like instance of either ArcSettingList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci_client.models.ArcSettingList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArcSettingList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_cluster.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + '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') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ArcSettingList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.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) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings'} # type: ignore + + async def get( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + **kwargs: Any + ) -> "_models.ArcSetting": + """Get ArcSetting resource details of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. + :type arc_setting_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ArcSetting, or the result of cls(response) + :rtype: ~azure_stack_hci_client.models.ArcSetting + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArcSetting"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_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('ArcSetting', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}'} # type: ignore + + async def create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: "_models.ArcSetting", + **kwargs: Any + ) -> "_models.ArcSetting": + """Create ArcSetting for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. + :type arc_setting_name: str + :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. + :type arc_setting: ~azure_stack_hci_client.models.ArcSetting + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ArcSetting, or the result of cls(response) + :rtype: ~azure_stack_hci_client.models.ArcSetting + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArcSetting"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_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(arc_setting, 'ArcSetting') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ArcSetting', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_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 = "2021-01-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_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, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete ArcSetting resource details of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. + :type arc_setting_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, 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_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}'} # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_clusters_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_clusters_operations.py index 7f3bc929b1e5..527d5651a143 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_clusters_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_clusters_operations.py @@ -57,7 +57,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-10-01" + api_version = "2021-01-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -127,7 +127,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-10-01" + api_version = "2021-01-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -140,7 +140,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -201,14 +201,14 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-10-01" + api_version = "2021-01-01-preview" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -263,7 +263,7 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-10-01" + api_version = "2021-01-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -271,7 +271,7 @@ async def create( url = self.create.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -309,7 +309,7 @@ async def update( self, resource_group_name: str, cluster_name: str, - cluster: "_models.ClusterUpdate", + cluster: "_models.ClusterPatch", **kwargs: Any ) -> "_models.Cluster": """Update an HCI cluster. @@ -319,7 +319,7 @@ async def update( :param cluster_name: The name of the cluster. :type cluster_name: str :param cluster: Details of the HCI cluster. - :type cluster: ~azure_stack_hci_client.models.ClusterUpdate + :type cluster: ~azure_stack_hci_client.models.ClusterPatch :keyword callable cls: A custom type or function that will be passed the direct response :return: Cluster, or the result of cls(response) :rtype: ~azure_stack_hci_client.models.Cluster @@ -330,7 +330,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-10-01" + api_version = "2021-01-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -338,7 +338,7 @@ async def update( url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -353,7 +353,7 @@ async def update( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(cluster, 'ClusterUpdate') + body_content = self._serialize.body(cluster, 'ClusterPatch') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -394,14 +394,14 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-10-01" + api_version = "2021-01-01-preview" accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_extensions_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_extensions_operations.py new file mode 100644 index 000000000000..6a9801001e6b --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_extensions_operations.py @@ -0,0 +1,600 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ExtensionsOperations: + """ExtensionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_stack_hci_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_arc_setting( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ExtensionList"]: + """List all Extensions under ArcSetting resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. + :type arc_setting_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExtensionList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci_client.models.ExtensionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_arc_setting.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ExtensionList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.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) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_arc_setting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions'} # type: ignore + + async def get( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + **kwargs: Any + ) -> "_models.Extension": + """Get particular Arc Extension of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. + :type arc_setting_name: str + :param extension_name: The name of the machine 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_stack_hci_client.models.Extension + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_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('Extension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}'} # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: "_models.Extension", + **kwargs: Any + ) -> "_models.Extension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_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(extension, 'Extension') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Extension', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Extension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: "_models.Extension", + **kwargs: Any + ) -> AsyncLROPoller["_models.Extension"]: + """Create Extension for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. + :type extension: ~azure_stack_hci_client.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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure_stack_hci_client.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + extension=extension, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Extension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, 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_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: "_models.Extension", + **kwargs: Any + ) -> "_models.Extension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_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(extension, 'Extension') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + 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('Extension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: "_models.Extension", + **kwargs: Any + ) -> AsyncLROPoller["_models.Extension"]: + """Update Extension for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. + :type extension: ~azure_stack_hci_client.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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure_stack_hci_client.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + extension=extension, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Extension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_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 = "2021-01-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_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, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete particular Arc Extension of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. + :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: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, 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_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}'} # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_operations.py index 6404b250abb6..019128f65482 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_operations.py @@ -43,20 +43,20 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list( self, **kwargs: Any - ) -> "_models.AvailableOperations": + ) -> "_models.OperationListResult": """List all available Microsoft.AzureStackHCI provider operations. :keyword callable cls: A custom type or function that will be passed the direct response - :return: AvailableOperations, or the result of cls(response) - :rtype: ~azure_stack_hci_client.models.AvailableOperations + :return: OperationListResult, or the result of cls(response) + :rtype: ~azure_stack_hci_client.models.OperationListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableOperations"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-10-01" + api_version = "2021-01-01-preview" accept = "application/json" # Construct URL @@ -79,7 +79,7 @@ async def list( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('AvailableOperations', pipeline_response) + deserialized = self._deserialize('OperationListResult', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/__init__.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/__init__.py index 600754b3df44..6675e25c8293 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/__init__.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/__init__.py @@ -7,55 +7,88 @@ # -------------------------------------------------------------------------- try: - from ._models_py3 import AvailableOperations + from ._models_py3 import ArcSetting + from ._models_py3 import ArcSettingList from ._models_py3 import Cluster from ._models_py3 import ClusterList from ._models_py3 import ClusterNode + from ._models_py3 import ClusterPatch from ._models_py3 import ClusterReportedProperties - from ._models_py3 import ClusterUpdate from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse - from ._models_py3 import OperationDetail + from ._models_py3 import Extension + from ._models_py3 import ExtensionList + from ._models_py3 import Operation from ._models_py3 import OperationDisplay + from ._models_py3 import OperationListResult + from ._models_py3 import PerNodeExtensionState + from ._models_py3 import PerNodeState + from ._models_py3 import ProxyResource from ._models_py3 import Resource from ._models_py3 import TrackedResource except (SyntaxError, ImportError): - from ._models import AvailableOperations # type: ignore + from ._models import ArcSetting # type: ignore + from ._models import ArcSettingList # type: ignore from ._models import Cluster # type: ignore from ._models import ClusterList # type: ignore from ._models import ClusterNode # type: ignore + from ._models import ClusterPatch # type: ignore from ._models import ClusterReportedProperties # type: ignore - from ._models import ClusterUpdate # type: ignore from ._models import ErrorAdditionalInfo # type: ignore from ._models import ErrorDetail # type: ignore from ._models import ErrorResponse # type: ignore - from ._models import OperationDetail # type: ignore + from ._models import Extension # type: ignore + from ._models import ExtensionList # type: ignore + from ._models import Operation # type: ignore from ._models import OperationDisplay # type: ignore + from ._models import OperationListResult # type: ignore + from ._models import PerNodeExtensionState # type: ignore + from ._models import PerNodeState # type: ignore + from ._models import ProxyResource # type: ignore from ._models import Resource # type: ignore from ._models import TrackedResource # type: ignore from ._azure_stack_hci_client_enums import ( + ActionType, + ArcSettingAggregateState, CreatedByType, + ExtensionAggregateState, + NodeArcState, + NodeExtensionState, + Origin, ProvisioningState, Status, ) __all__ = [ - 'AvailableOperations', + 'ArcSetting', + 'ArcSettingList', 'Cluster', 'ClusterList', 'ClusterNode', + 'ClusterPatch', 'ClusterReportedProperties', - 'ClusterUpdate', 'ErrorAdditionalInfo', 'ErrorDetail', 'ErrorResponse', - 'OperationDetail', + 'Extension', + 'ExtensionList', + 'Operation', 'OperationDisplay', + 'OperationListResult', + 'PerNodeExtensionState', + 'PerNodeState', + 'ProxyResource', 'Resource', 'TrackedResource', + 'ActionType', + 'ArcSettingAggregateState', 'CreatedByType', + 'ExtensionAggregateState', + 'NodeArcState', + 'NodeExtensionState', + 'Origin', 'ProvisioningState', 'Status', ] diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_azure_stack_hci_client_enums.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_azure_stack_hci_client_enums.py index 2ae785e6379c..5b3ae6cc1a3c 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_azure_stack_hci_client_enums.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_azure_stack_hci_client_enums.py @@ -26,6 +26,32 @@ def __getattr__(cls, name): raise AttributeError(name) +class ActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + """ + + INTERNAL = "Internal" + +class ArcSettingAggregateState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Aggregate state of Arc agent across the nodes in this HCI cluster. + """ + + NOT_SPECIFIED = "NotSpecified" + ERROR = "Error" + SUCCEEDED = "Succeeded" + CANCELED = "Canceled" + FAILED = "Failed" + CONNECTED = "Connected" + DISCONNECTED = "Disconnected" + DELETED = "Deleted" + CREATING = "Creating" + UPDATING = "Updating" + DELETING = "Deleting" + MOVING = "Moving" + PARTIALLY_SUCCEEDED = "PartiallySucceeded" + PARTIALLY_CONNECTED = "PartiallyConnected" + IN_PROGRESS = "InProgress" + class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of identity that created the resource. """ @@ -35,8 +61,71 @@ class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" +class ExtensionAggregateState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Aggregate state of Arc Extensions across the nodes in this HCI cluster. + """ + + NOT_SPECIFIED = "NotSpecified" + ERROR = "Error" + SUCCEEDED = "Succeeded" + CANCELED = "Canceled" + FAILED = "Failed" + CONNECTED = "Connected" + DISCONNECTED = "Disconnected" + DELETED = "Deleted" + CREATING = "Creating" + UPDATING = "Updating" + DELETING = "Deleting" + MOVING = "Moving" + PARTIALLY_SUCCEEDED = "PartiallySucceeded" + PARTIALLY_CONNECTED = "PartiallyConnected" + IN_PROGRESS = "InProgress" + +class NodeArcState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """State of Arc agent in this node. + """ + + NOT_SPECIFIED = "NotSpecified" + ERROR = "Error" + SUCCEEDED = "Succeeded" + CANCELED = "Canceled" + FAILED = "Failed" + CONNECTED = "Connected" + DISCONNECTED = "Disconnected" + DELETED = "Deleted" + CREATING = "Creating" + UPDATING = "Updating" + DELETING = "Deleting" + MOVING = "Moving" + +class NodeExtensionState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """State of Arc Extension in this node. + """ + + NOT_SPECIFIED = "NotSpecified" + ERROR = "Error" + SUCCEEDED = "Succeeded" + CANCELED = "Canceled" + FAILED = "Failed" + CONNECTED = "Connected" + DISCONNECTED = "Disconnected" + DELETED = "Deleted" + CREATING = "Creating" + UPDATING = "Updating" + DELETING = "Deleting" + MOVING = "Moving" + +class Origin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + logs UX. Default value is "user,system" + """ + + USER = "user" + SYSTEM = "system" + USER_SYSTEM = "user,system" + class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Provisioning state. + """Provisioning state of the ArcSetting proxy resource. """ SUCCEEDED = "Succeeded" diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_models.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_models.py index 513d8e361b87..4564c9472f42 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_models.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_models.py @@ -10,32 +10,45 @@ import msrest.serialization -class AvailableOperations(msrest.serialization.Model): - """Available operations of the service. - - :param value: Collection of available operation details. - :type value: list[~azure_stack_hci_client.models.OperationDetail] - :param next_link: URL client should use to fetch the next page (per server side paging). - It's null for now, added for future use. - :type next_link: str +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str """ + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationDetail]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } def __init__( self, **kwargs ): - super(AvailableOperations, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. Variables are only populated by the server, and will be ignored when sending a request. @@ -65,10 +78,122 @@ def __init__( self, **kwargs ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None + super(ProxyResource, self).__init__(**kwargs) + + +class ArcSetting(ProxyResource): + """ArcSetting details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar provisioning_state: Provisioning state of the ArcSetting proxy resource. Possible values + include: "Succeeded", "Failed", "Canceled", "Accepted", "Provisioning". + :vartype provisioning_state: str or ~azure_stack_hci_client.models.ProvisioningState + :ivar arc_instance_resource_group: The resource group that hosts the Arc agents, ie. Hybrid + Compute Machine resources. + :vartype arc_instance_resource_group: str + :ivar aggregate_state: Aggregate state of Arc agent across the nodes in this HCI cluster. + Possible values include: "NotSpecified", "Error", "Succeeded", "Canceled", "Failed", + "Connected", "Disconnected", "Deleted", "Creating", "Updating", "Deleting", "Moving", + "PartiallySucceeded", "PartiallyConnected", "InProgress". + :vartype aggregate_state: str or ~azure_stack_hci_client.models.ArcSettingAggregateState + :ivar per_node_details: State of Arc agent in each of the nodes. + :vartype per_node_details: list[~azure_stack_hci_client.models.PerNodeState] + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure_stack_hci_client.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure_stack_hci_client.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'arc_instance_resource_group': {'readonly': True}, + 'aggregate_state': {'readonly': True}, + 'per_node_details': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'arc_instance_resource_group': {'key': 'properties.arcInstanceResourceGroup', 'type': 'str'}, + 'aggregate_state': {'key': 'properties.aggregateState', 'type': 'str'}, + 'per_node_details': {'key': 'properties.perNodeDetails', 'type': '[PerNodeState]'}, + 'created_by': {'key': 'systemData.createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'systemData.createdByType', 'type': 'str'}, + 'created_at': {'key': 'systemData.createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'systemData.lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'systemData.lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'systemData.lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(ArcSetting, self).__init__(**kwargs) + self.provisioning_state = None + self.arc_instance_resource_group = None + self.aggregate_state = None + self.per_node_details = None + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class ArcSettingList(msrest.serialization.Model): + """List of ArcSetting proxy resources for the HCI cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ArcSetting proxy resources. + :vartype value: list[~azure_stack_hci_client.models.ArcSetting] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ArcSetting]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ArcSettingList, self).__init__(**kwargs) + self.value = None + self.next_link = None class TrackedResource(Resource): @@ -143,12 +268,14 @@ class Cluster(TrackedResource): :vartype status: str or ~azure_stack_hci_client.models.Status :ivar cloud_id: Unique, immutable resource id. :vartype cloud_id: str + :param cloud_management_endpoint: Endpoint configured for management from the Azure portal. + :type cloud_management_endpoint: str :param aad_client_id: App id of cluster AAD identity. :type aad_client_id: str :param aad_tenant_id: Tenant id of cluster AAD identity. :type aad_tenant_id: str - :param reported_properties: Properties reported by cluster agent. - :type reported_properties: ~azure_stack_hci_client.models.ClusterReportedProperties + :ivar reported_properties: Properties reported by cluster agent. + :vartype reported_properties: ~azure_stack_hci_client.models.ClusterReportedProperties :ivar trial_days_remaining: Number of days remaining in the trial period. :vartype trial_days_remaining: float :ivar billing_model: Type of billing applied to the resource. @@ -183,6 +310,7 @@ class Cluster(TrackedResource): 'provisioning_state': {'readonly': True}, 'status': {'readonly': True}, 'cloud_id': {'readonly': True}, + 'reported_properties': {'readonly': True}, 'trial_days_remaining': {'readonly': True}, 'billing_model': {'readonly': True}, 'registration_timestamp': {'readonly': True}, @@ -199,6 +327,7 @@ class Cluster(TrackedResource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, 'cloud_id': {'key': 'properties.cloudId', 'type': 'str'}, + 'cloud_management_endpoint': {'key': 'properties.cloudManagementEndpoint', 'type': 'str'}, 'aad_client_id': {'key': 'properties.aadClientId', 'type': 'str'}, 'aad_tenant_id': {'key': 'properties.aadTenantId', 'type': 'str'}, 'reported_properties': {'key': 'properties.reportedProperties', 'type': 'ClusterReportedProperties'}, @@ -223,9 +352,10 @@ def __init__( self.provisioning_state = None self.status = None self.cloud_id = None + self.cloud_management_endpoint = kwargs.get('cloud_management_endpoint', None) self.aad_client_id = kwargs.get('aad_client_id', None) self.aad_tenant_id = kwargs.get('aad_tenant_id', None) - self.reported_properties = kwargs.get('reported_properties', None) + self.reported_properties = None self.trial_days_remaining = None self.billing_model = None self.registration_timestamp = None @@ -333,6 +463,29 @@ def __init__( self.memory_in_gi_b = None +class ClusterPatch(msrest.serialization.Model): + """Cluster details to update. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param cloud_management_endpoint: Endpoint configured for management from the Azure portal. + :type cloud_management_endpoint: str + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'cloud_management_endpoint': {'key': 'properties.cloudManagementEndpoint', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ClusterPatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.cloud_management_endpoint = kwargs.get('cloud_management_endpoint', None) + + class ClusterReportedProperties(msrest.serialization.Model): """Properties reported by cluster agent. @@ -378,25 +531,6 @@ def __init__( self.last_updated = None -class ClusterUpdate(msrest.serialization.Model): - """Cluster details to update. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(ClusterUpdate, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - class ErrorAdditionalInfo(msrest.serialization.Model): """The resource management error additional info. @@ -491,54 +625,222 @@ def __init__( self.error = kwargs.get('error', None) -class OperationDetail(msrest.serialization.Model): - """Operation detail payload. +class Extension(ProxyResource): + """Details of a particular extension in HCI Cluster. - :param name: Name of the operation. - :type name: str - :param is_data_action: Indicates whether the operation is a data action. - :type is_data_action: bool - :param display: Display of the operation. + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar provisioning_state: Provisioning state of the Extension proxy resource. Possible values + include: "Succeeded", "Failed", "Canceled", "Accepted", "Provisioning". + :vartype provisioning_state: str or ~azure_stack_hci_client.models.ProvisioningState + :ivar aggregate_state: Aggregate state of Arc Extensions across the nodes in this HCI cluster. + Possible values include: "NotSpecified", "Error", "Succeeded", "Canceled", "Failed", + "Connected", "Disconnected", "Deleted", "Creating", "Updating", "Deleting", "Moving", + "PartiallySucceeded", "PartiallyConnected", "InProgress". + :vartype aggregate_state: str or ~azure_stack_hci_client.models.ExtensionAggregateState + :ivar per_node_extension_details: State of Arc Extension in each of the nodes. + :vartype per_node_extension_details: list[~azure_stack_hci_client.models.PerNodeExtensionState] + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type_properties_extension_parameters_type: Specifies the type of the extension; an + example is "CustomScriptExtension". + :type type_properties_extension_parameters_type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: any + :param protected_settings: Protected settings (may contain secrets). + :type protected_settings: any + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure_stack_hci_client.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure_stack_hci_client.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'aggregate_state': {'readonly': True}, + 'per_node_extension_details': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'aggregate_state': {'key': 'properties.aggregateState', 'type': 'str'}, + 'per_node_extension_details': {'key': 'properties.perNodeExtensionDetails', 'type': '[PerNodeExtensionState]'}, + 'force_update_tag': {'key': 'properties.extensionParameters.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.extensionParameters.publisher', 'type': 'str'}, + 'type_properties_extension_parameters_type': {'key': 'properties.extensionParameters.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.extensionParameters.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.extensionParameters.autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'properties.extensionParameters.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.extensionParameters.protectedSettings', 'type': 'object'}, + 'created_by': {'key': 'systemData.createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'systemData.createdByType', 'type': 'str'}, + 'created_at': {'key': 'systemData.createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'systemData.lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'systemData.lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'systemData.lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(Extension, self).__init__(**kwargs) + self.provisioning_state = None + self.aggregate_state = None + self.per_node_extension_details = None + self.force_update_tag = kwargs.get('force_update_tag', None) + self.publisher = kwargs.get('publisher', None) + self.type_properties_extension_parameters_type = kwargs.get('type_properties_extension_parameters_type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class ExtensionList(msrest.serialization.Model): + """List of Extensions in HCI cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Extensions in HCI cluster. + :vartype value: list[~azure_stack_hci_client.models.Extension] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Extension]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Operation(msrest.serialization.Model): + """Details of a REST API operation, returned from the Resource Provider Operations API. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + :vartype name: str + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for + data-plane operations and "false" for ARM/control-plane operations. + :vartype is_data_action: bool + :param display: Localized display information for this particular operation. :type display: ~azure_stack_hci_client.models.OperationDisplay - :param origin: Origin of the operation. - :type origin: str - :param properties: Properties of the operation. - :type properties: any + :ivar origin: The intended executor of the operation; as in Resource Based Access Control + (RBAC) and audit logs UX. Default value is "user,system". Possible values include: "user", + "system", "user,system". + :vartype origin: str or ~azure_stack_hci_client.models.Origin + :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for + internal only APIs. Possible values include: "Internal". + :vartype action_type: str or ~azure_stack_hci_client.models.ActionType """ + _validation = { + 'name': {'readonly': True}, + 'is_data_action': {'readonly': True}, + 'origin': {'readonly': True}, + 'action_type': {'readonly': True}, + } + _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, } def __init__( self, **kwargs ): - super(OperationDetail, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.is_data_action = kwargs.get('is_data_action', None) + super(Operation, self).__init__(**kwargs) + self.name = None + self.is_data_action = None self.display = kwargs.get('display', None) - self.origin = kwargs.get('origin', None) - self.properties = kwargs.get('properties', None) + self.origin = None + self.action_type = None class OperationDisplay(msrest.serialization.Model): - """Operation display payload. - - :param provider: Resource provider of the operation. - :type provider: str - :param resource: Resource of the operation. - :type resource: str - :param operation: Localized friendly name for the operation. - :type operation: str - :param description: Localized friendly description for the operation. - :type description: str + """Localized display information for this particular operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft + Monitoring Insights" or "Microsoft Compute". + :vartype provider: str + :ivar resource: The localized friendly name of the resource type related to this operation. + E.g. "Virtual Machines" or "Job Schedule Collections". + :vartype resource: str + :ivar operation: The concise, localized friendly name for the operation; suitable for + dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + :vartype operation: str + :ivar description: The short, localized friendly description of the operation; suitable for + tool tips and detailed views. + :vartype description: str """ + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + _attribute_map = { 'provider': {'key': 'provider', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'str'}, @@ -551,7 +853,111 @@ def __init__( **kwargs ): super(OperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class OperationListResult(msrest.serialization.Model): + """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of operations supported by the resource provider. + :vartype value: list[~azure_stack_hci_client.models.Operation] + :ivar next_link: URL to get the next set of operation list results (if there are any). + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class PerNodeExtensionState(msrest.serialization.Model): + """Status of Arc Extension for a particular node in HCI Cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the node in HCI Cluster. + :vartype name: str + :ivar extension: Fully qualified resource ID for the particular Arc Extension on this node. + :vartype extension: str + :ivar state: State of Arc Extension in this node. Possible values include: "NotSpecified", + "Error", "Succeeded", "Canceled", "Failed", "Connected", "Disconnected", "Deleted", "Creating", + "Updating", "Deleting", "Moving". + :vartype state: str or ~azure_stack_hci_client.models.NodeExtensionState + """ + + _validation = { + 'name': {'readonly': True}, + 'extension': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'extension': {'key': 'extension', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PerNodeExtensionState, self).__init__(**kwargs) + self.name = None + self.extension = None + self.state = None + + +class PerNodeState(msrest.serialization.Model): + """Status of Arc agent for a particular node in HCI Cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the Node in HCI Cluster. + :vartype name: str + :ivar arc_instance: Fully qualified resource ID for the Arc agent of this node. + :vartype arc_instance: str + :ivar state: State of Arc agent in this node. Possible values include: "NotSpecified", "Error", + "Succeeded", "Canceled", "Failed", "Connected", "Disconnected", "Deleted", "Creating", + "Updating", "Deleting", "Moving". + :vartype state: str or ~azure_stack_hci_client.models.NodeArcState + """ + + _validation = { + 'name': {'readonly': True}, + 'arc_instance': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'arc_instance': {'key': 'arcInstance', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PerNodeState, self).__init__(**kwargs) + self.name = None + self.arc_instance = None + self.state = None diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_models_py3.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_models_py3.py index 80df7c74fe1d..cfede6b86641 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_models_py3.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_models_py3.py @@ -15,35 +15,45 @@ from ._azure_stack_hci_client_enums import * -class AvailableOperations(msrest.serialization.Model): - """Available operations of the service. - - :param value: Collection of available operation details. - :type value: list[~azure_stack_hci_client.models.OperationDetail] - :param next_link: URL client should use to fetch the next page (per server side paging). - It's null for now, added for future use. - :type next_link: str +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str """ + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationDetail]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } def __init__( self, - *, - value: Optional[List["OperationDetail"]] = None, - next_link: Optional[str] = None, **kwargs ): - super(AvailableOperations, self).__init__(**kwargs) - self.value = value - self.next_link = next_link + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. Variables are only populated by the server, and will be ignored when sending a request. @@ -73,10 +83,129 @@ def __init__( self, **kwargs ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None + super(ProxyResource, self).__init__(**kwargs) + + +class ArcSetting(ProxyResource): + """ArcSetting details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar provisioning_state: Provisioning state of the ArcSetting proxy resource. Possible values + include: "Succeeded", "Failed", "Canceled", "Accepted", "Provisioning". + :vartype provisioning_state: str or ~azure_stack_hci_client.models.ProvisioningState + :ivar arc_instance_resource_group: The resource group that hosts the Arc agents, ie. Hybrid + Compute Machine resources. + :vartype arc_instance_resource_group: str + :ivar aggregate_state: Aggregate state of Arc agent across the nodes in this HCI cluster. + Possible values include: "NotSpecified", "Error", "Succeeded", "Canceled", "Failed", + "Connected", "Disconnected", "Deleted", "Creating", "Updating", "Deleting", "Moving", + "PartiallySucceeded", "PartiallyConnected", "InProgress". + :vartype aggregate_state: str or ~azure_stack_hci_client.models.ArcSettingAggregateState + :ivar per_node_details: State of Arc agent in each of the nodes. + :vartype per_node_details: list[~azure_stack_hci_client.models.PerNodeState] + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure_stack_hci_client.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure_stack_hci_client.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'arc_instance_resource_group': {'readonly': True}, + 'aggregate_state': {'readonly': True}, + 'per_node_details': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'arc_instance_resource_group': {'key': 'properties.arcInstanceResourceGroup', 'type': 'str'}, + 'aggregate_state': {'key': 'properties.aggregateState', 'type': 'str'}, + 'per_node_details': {'key': 'properties.perNodeDetails', 'type': '[PerNodeState]'}, + 'created_by': {'key': 'systemData.createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'systemData.createdByType', 'type': 'str'}, + 'created_at': {'key': 'systemData.createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'systemData.lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'systemData.lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'systemData.lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(ArcSetting, self).__init__(**kwargs) + self.provisioning_state = None + self.arc_instance_resource_group = None + self.aggregate_state = None + self.per_node_details = None + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class ArcSettingList(msrest.serialization.Model): + """List of ArcSetting proxy resources for the HCI cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ArcSetting proxy resources. + :vartype value: list[~azure_stack_hci_client.models.ArcSetting] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ArcSetting]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ArcSettingList, self).__init__(**kwargs) + self.value = None + self.next_link = None class TrackedResource(Resource): @@ -154,12 +283,14 @@ class Cluster(TrackedResource): :vartype status: str or ~azure_stack_hci_client.models.Status :ivar cloud_id: Unique, immutable resource id. :vartype cloud_id: str + :param cloud_management_endpoint: Endpoint configured for management from the Azure portal. + :type cloud_management_endpoint: str :param aad_client_id: App id of cluster AAD identity. :type aad_client_id: str :param aad_tenant_id: Tenant id of cluster AAD identity. :type aad_tenant_id: str - :param reported_properties: Properties reported by cluster agent. - :type reported_properties: ~azure_stack_hci_client.models.ClusterReportedProperties + :ivar reported_properties: Properties reported by cluster agent. + :vartype reported_properties: ~azure_stack_hci_client.models.ClusterReportedProperties :ivar trial_days_remaining: Number of days remaining in the trial period. :vartype trial_days_remaining: float :ivar billing_model: Type of billing applied to the resource. @@ -194,6 +325,7 @@ class Cluster(TrackedResource): 'provisioning_state': {'readonly': True}, 'status': {'readonly': True}, 'cloud_id': {'readonly': True}, + 'reported_properties': {'readonly': True}, 'trial_days_remaining': {'readonly': True}, 'billing_model': {'readonly': True}, 'registration_timestamp': {'readonly': True}, @@ -210,6 +342,7 @@ class Cluster(TrackedResource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, 'cloud_id': {'key': 'properties.cloudId', 'type': 'str'}, + 'cloud_management_endpoint': {'key': 'properties.cloudManagementEndpoint', 'type': 'str'}, 'aad_client_id': {'key': 'properties.aadClientId', 'type': 'str'}, 'aad_tenant_id': {'key': 'properties.aadTenantId', 'type': 'str'}, 'reported_properties': {'key': 'properties.reportedProperties', 'type': 'ClusterReportedProperties'}, @@ -231,9 +364,9 @@ def __init__( *, location: str, tags: Optional[Dict[str, str]] = None, + cloud_management_endpoint: Optional[str] = None, aad_client_id: Optional[str] = None, aad_tenant_id: Optional[str] = None, - reported_properties: Optional["ClusterReportedProperties"] = None, created_by: Optional[str] = None, created_by_type: Optional[Union[str, "CreatedByType"]] = None, created_at: Optional[datetime.datetime] = None, @@ -246,9 +379,10 @@ def __init__( self.provisioning_state = None self.status = None self.cloud_id = None + self.cloud_management_endpoint = cloud_management_endpoint self.aad_client_id = aad_client_id self.aad_tenant_id = aad_tenant_id - self.reported_properties = reported_properties + self.reported_properties = None self.trial_days_remaining = None self.billing_model = None self.registration_timestamp = None @@ -358,6 +492,32 @@ def __init__( self.memory_in_gi_b = None +class ClusterPatch(msrest.serialization.Model): + """Cluster details to update. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param cloud_management_endpoint: Endpoint configured for management from the Azure portal. + :type cloud_management_endpoint: str + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'cloud_management_endpoint': {'key': 'properties.cloudManagementEndpoint', 'type': 'str'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + cloud_management_endpoint: Optional[str] = None, + **kwargs + ): + super(ClusterPatch, self).__init__(**kwargs) + self.tags = tags + self.cloud_management_endpoint = cloud_management_endpoint + + class ClusterReportedProperties(msrest.serialization.Model): """Properties reported by cluster agent. @@ -403,27 +563,6 @@ def __init__( self.last_updated = None -class ClusterUpdate(msrest.serialization.Model): - """Cluster details to update. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - super(ClusterUpdate, self).__init__(**kwargs) - self.tags = tags - - class ErrorAdditionalInfo(msrest.serialization.Model): """The resource management error additional info. @@ -520,60 +659,238 @@ def __init__( self.error = error -class OperationDetail(msrest.serialization.Model): - """Operation detail payload. +class Extension(ProxyResource): + """Details of a particular extension in HCI Cluster. - :param name: Name of the operation. - :type name: str - :param is_data_action: Indicates whether the operation is a data action. - :type is_data_action: bool - :param display: Display of the operation. + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar provisioning_state: Provisioning state of the Extension proxy resource. Possible values + include: "Succeeded", "Failed", "Canceled", "Accepted", "Provisioning". + :vartype provisioning_state: str or ~azure_stack_hci_client.models.ProvisioningState + :ivar aggregate_state: Aggregate state of Arc Extensions across the nodes in this HCI cluster. + Possible values include: "NotSpecified", "Error", "Succeeded", "Canceled", "Failed", + "Connected", "Disconnected", "Deleted", "Creating", "Updating", "Deleting", "Moving", + "PartiallySucceeded", "PartiallyConnected", "InProgress". + :vartype aggregate_state: str or ~azure_stack_hci_client.models.ExtensionAggregateState + :ivar per_node_extension_details: State of Arc Extension in each of the nodes. + :vartype per_node_extension_details: list[~azure_stack_hci_client.models.PerNodeExtensionState] + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type_properties_extension_parameters_type: Specifies the type of the extension; an + example is "CustomScriptExtension". + :type type_properties_extension_parameters_type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: any + :param protected_settings: Protected settings (may contain secrets). + :type protected_settings: any + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure_stack_hci_client.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure_stack_hci_client.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'aggregate_state': {'readonly': True}, + 'per_node_extension_details': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'aggregate_state': {'key': 'properties.aggregateState', 'type': 'str'}, + 'per_node_extension_details': {'key': 'properties.perNodeExtensionDetails', 'type': '[PerNodeExtensionState]'}, + 'force_update_tag': {'key': 'properties.extensionParameters.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.extensionParameters.publisher', 'type': 'str'}, + 'type_properties_extension_parameters_type': {'key': 'properties.extensionParameters.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.extensionParameters.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.extensionParameters.autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'properties.extensionParameters.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.extensionParameters.protectedSettings', 'type': 'object'}, + 'created_by': {'key': 'systemData.createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'systemData.createdByType', 'type': 'str'}, + 'created_at': {'key': 'systemData.createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'systemData.lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'systemData.lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'systemData.lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + force_update_tag: Optional[str] = None, + publisher: Optional[str] = None, + type_properties_extension_parameters_type: Optional[str] = None, + type_handler_version: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = None, + settings: Optional[Any] = None, + protected_settings: Optional[Any] = None, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(Extension, self).__init__(**kwargs) + self.provisioning_state = None + self.aggregate_state = None + self.per_node_extension_details = None + self.force_update_tag = force_update_tag + self.publisher = publisher + self.type_properties_extension_parameters_type = type_properties_extension_parameters_type + self.type_handler_version = type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.settings = settings + self.protected_settings = protected_settings + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class ExtensionList(msrest.serialization.Model): + """List of Extensions in HCI cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Extensions in HCI cluster. + :vartype value: list[~azure_stack_hci_client.models.Extension] + :ivar next_link: Link to the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Extension]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class Operation(msrest.serialization.Model): + """Details of a REST API operation, returned from the Resource Provider Operations API. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + :vartype name: str + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for + data-plane operations and "false" for ARM/control-plane operations. + :vartype is_data_action: bool + :param display: Localized display information for this particular operation. :type display: ~azure_stack_hci_client.models.OperationDisplay - :param origin: Origin of the operation. - :type origin: str - :param properties: Properties of the operation. - :type properties: any + :ivar origin: The intended executor of the operation; as in Resource Based Access Control + (RBAC) and audit logs UX. Default value is "user,system". Possible values include: "user", + "system", "user,system". + :vartype origin: str or ~azure_stack_hci_client.models.Origin + :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for + internal only APIs. Possible values include: "Internal". + :vartype action_type: str or ~azure_stack_hci_client.models.ActionType """ + _validation = { + 'name': {'readonly': True}, + 'is_data_action': {'readonly': True}, + 'origin': {'readonly': True}, + 'action_type': {'readonly': True}, + } + _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, } def __init__( self, *, - name: Optional[str] = None, - is_data_action: Optional[bool] = None, display: Optional["OperationDisplay"] = None, - origin: Optional[str] = None, - properties: Optional[Any] = None, **kwargs ): - super(OperationDetail, self).__init__(**kwargs) - self.name = name - self.is_data_action = is_data_action + super(Operation, self).__init__(**kwargs) + self.name = None + self.is_data_action = None self.display = display - self.origin = origin - self.properties = properties + self.origin = None + self.action_type = None class OperationDisplay(msrest.serialization.Model): - """Operation display payload. - - :param provider: Resource provider of the operation. - :type provider: str - :param resource: Resource of the operation. - :type resource: str - :param operation: Localized friendly name for the operation. - :type operation: str - :param description: Localized friendly description for the operation. - :type description: str + """Localized display information for this particular operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft + Monitoring Insights" or "Microsoft Compute". + :vartype provider: str + :ivar resource: The localized friendly name of the resource type related to this operation. + E.g. "Virtual Machines" or "Job Schedule Collections". + :vartype resource: str + :ivar operation: The concise, localized friendly name for the operation; suitable for + dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + :vartype operation: str + :ivar description: The short, localized friendly description of the operation; suitable for + tool tips and detailed views. + :vartype description: str """ + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + _attribute_map = { 'provider': {'key': 'provider', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'str'}, @@ -583,15 +900,114 @@ class OperationDisplay(msrest.serialization.Model): def __init__( self, - *, - provider: Optional[str] = None, - resource: Optional[str] = None, - operation: Optional[str] = None, - description: Optional[str] = None, **kwargs ): super(OperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class OperationListResult(msrest.serialization.Model): + """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of operations supported by the resource provider. + :vartype value: list[~azure_stack_hci_client.models.Operation] + :ivar next_link: URL to get the next set of operation list results (if there are any). + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class PerNodeExtensionState(msrest.serialization.Model): + """Status of Arc Extension for a particular node in HCI Cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the node in HCI Cluster. + :vartype name: str + :ivar extension: Fully qualified resource ID for the particular Arc Extension on this node. + :vartype extension: str + :ivar state: State of Arc Extension in this node. Possible values include: "NotSpecified", + "Error", "Succeeded", "Canceled", "Failed", "Connected", "Disconnected", "Deleted", "Creating", + "Updating", "Deleting", "Moving". + :vartype state: str or ~azure_stack_hci_client.models.NodeExtensionState + """ + + _validation = { + 'name': {'readonly': True}, + 'extension': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'extension': {'key': 'extension', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PerNodeExtensionState, self).__init__(**kwargs) + self.name = None + self.extension = None + self.state = None + + +class PerNodeState(msrest.serialization.Model): + """Status of Arc agent for a particular node in HCI Cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the Node in HCI Cluster. + :vartype name: str + :ivar arc_instance: Fully qualified resource ID for the Arc agent of this node. + :vartype arc_instance: str + :ivar state: State of Arc agent in this node. Possible values include: "NotSpecified", "Error", + "Succeeded", "Canceled", "Failed", "Connected", "Disconnected", "Deleted", "Creating", + "Updating", "Deleting", "Moving". + :vartype state: str or ~azure_stack_hci_client.models.NodeArcState + """ + + _validation = { + 'name': {'readonly': True}, + 'arc_instance': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'arc_instance': {'key': 'arcInstance', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PerNodeState, self).__init__(**kwargs) + self.name = None + self.arc_instance = None + self.state = None diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/__init__.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/__init__.py index b0a4c9469927..d3211472e48c 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/__init__.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/__init__.py @@ -6,10 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._operations import Operations +from ._arc_settings_operations import ArcSettingsOperations from ._clusters_operations import ClustersOperations +from ._extensions_operations import ExtensionsOperations +from ._operations import Operations __all__ = [ - 'Operations', + 'ArcSettingsOperations', 'ClustersOperations', + 'ExtensionsOperations', + 'Operations', ] diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_arc_settings_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_arc_settings_operations.py new file mode 100644 index 000000000000..f27601576940 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_arc_settings_operations.py @@ -0,0 +1,381 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ArcSettingsOperations(object): + """ArcSettingsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_stack_hci_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_cluster( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ArcSettingList"] + """Get ArcSetting resources of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :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: An iterator like instance of either ArcSettingList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_stack_hci_client.models.ArcSettingList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArcSettingList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_cluster.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + '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') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ArcSettingList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.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) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings'} # type: ignore + + def get( + self, + resource_group_name, # type: str + cluster_name, # type: str + arc_setting_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ArcSetting" + """Get ArcSetting resource details of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. + :type arc_setting_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ArcSetting, or the result of cls(response) + :rtype: ~azure_stack_hci_client.models.ArcSetting + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArcSetting"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_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('ArcSetting', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}'} # type: ignore + + def create( + self, + resource_group_name, # type: str + cluster_name, # type: str + arc_setting_name, # type: str + arc_setting, # type: "_models.ArcSetting" + **kwargs # type: Any + ): + # type: (...) -> "_models.ArcSetting" + """Create ArcSetting for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. + :type arc_setting_name: str + :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. + :type arc_setting: ~azure_stack_hci_client.models.ArcSetting + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ArcSetting, or the result of cls(response) + :rtype: ~azure_stack_hci_client.models.ArcSetting + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArcSetting"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_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(arc_setting, 'ArcSetting') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ArcSetting', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + arc_setting_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 = "2021-01-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_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, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + cluster_name, # type: str + arc_setting_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Delete ArcSetting resource details of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. + :type arc_setting_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, 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_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}'} # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_clusters_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_clusters_operations.py index f5705c628798..9e1231d58a23 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_clusters_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_clusters_operations.py @@ -62,7 +62,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-10-01" + api_version = "2021-01-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -133,7 +133,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-10-01" + api_version = "2021-01-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -146,7 +146,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -208,14 +208,14 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-10-01" + api_version = "2021-01-01-preview" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -271,7 +271,7 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-10-01" + api_version = "2021-01-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -279,7 +279,7 @@ def create( url = self.create.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -317,7 +317,7 @@ def update( self, resource_group_name, # type: str cluster_name, # type: str - cluster, # type: "_models.ClusterUpdate" + cluster, # type: "_models.ClusterPatch" **kwargs # type: Any ): # type: (...) -> "_models.Cluster" @@ -328,7 +328,7 @@ def update( :param cluster_name: The name of the cluster. :type cluster_name: str :param cluster: Details of the HCI cluster. - :type cluster: ~azure_stack_hci_client.models.ClusterUpdate + :type cluster: ~azure_stack_hci_client.models.ClusterPatch :keyword callable cls: A custom type or function that will be passed the direct response :return: Cluster, or the result of cls(response) :rtype: ~azure_stack_hci_client.models.Cluster @@ -339,7 +339,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-10-01" + api_version = "2021-01-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -347,7 +347,7 @@ def update( url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -362,7 +362,7 @@ def update( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(cluster, 'ClusterUpdate') + body_content = self._serialize.body(cluster, 'ClusterPatch') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -404,14 +404,14 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-10-01" + api_version = "2021-01-01-preview" accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_extensions_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_extensions_operations.py new file mode 100644 index 000000000000..012182e3a12e --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_extensions_operations.py @@ -0,0 +1,612 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ExtensionsOperations(object): + """ExtensionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_stack_hci_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_arc_setting( + self, + resource_group_name, # type: str + cluster_name, # type: str + arc_setting_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExtensionList"] + """List all Extensions under ArcSetting resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. + :type arc_setting_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExtensionList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_stack_hci_client.models.ExtensionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_arc_setting.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ExtensionList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.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) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_arc_setting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions'} # type: ignore + + def get( + self, + resource_group_name, # type: str + cluster_name, # type: str + arc_setting_name, # type: str + extension_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Extension" + """Get particular Arc Extension of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. + :type arc_setting_name: str + :param extension_name: The name of the machine 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_stack_hci_client.models.Extension + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_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('Extension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}'} # type: ignore + + def _create_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + arc_setting_name, # type: str + extension_name, # type: str + extension, # type: "_models.Extension" + **kwargs # type: Any + ): + # type: (...) -> "_models.Extension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_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(extension, 'Extension') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + 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 response.status_code == 200: + deserialized = self._deserialize('Extension', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Extension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + cluster_name, # type: str + arc_setting_name, # type: str + extension_name, # type: str + extension, # type: "_models.Extension" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Extension"] + """Create Extension for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. + :type extension: ~azure_stack_hci_client.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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Extension or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure_stack_hci_client.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + extension=extension, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Extension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, 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_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + arc_setting_name, # type: str + extension_name, # type: str + extension, # type: "_models.Extension" + **kwargs # type: Any + ): + # type: (...) -> "_models.Extension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_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(extension, 'Extension') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + 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('Extension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + cluster_name, # type: str + arc_setting_name, # type: str + extension_name, # type: str + extension, # type: "_models.Extension" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Extension"] + """Update Extension for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. + :type extension: ~azure_stack_hci_client.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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Extension or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure_stack_hci_client.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + extension=extension, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Extension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + arc_setting_name, # type: str + extension_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 = "2021-01-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_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, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + cluster_name, # type: str + arc_setting_name, # type: str + extension_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Delete particular Arc Extension of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. + :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: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'arcSettingName': self._serialize.url("arc_setting_name", arc_setting_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, 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_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}'} # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_operations.py index a48f7f991098..8a40fa3d701c 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_operations.py @@ -48,20 +48,20 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> "_models.AvailableOperations" + # type: (...) -> "_models.OperationListResult" """List all available Microsoft.AzureStackHCI provider operations. :keyword callable cls: A custom type or function that will be passed the direct response - :return: AvailableOperations, or the result of cls(response) - :rtype: ~azure_stack_hci_client.models.AvailableOperations + :return: OperationListResult, or the result of cls(response) + :rtype: ~azure_stack_hci_client.models.OperationListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableOperations"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-10-01" + api_version = "2021-01-01-preview" accept = "application/json" # Construct URL @@ -84,7 +84,7 @@ def list( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('AvailableOperations', pipeline_response) + deserialized = self._deserialize('OperationListResult', pipeline_response) if cls: return cls(pipeline_response, deserialized, {})