From 32e6166f349d4032b850f93998e6a75d56e86756 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 12 Apr 2022 02:08:03 +0000 Subject: [PATCH] CodeGen from PR 18641 in Azure/azure-rest-api-specs config azurestackhci readme.java (#18641) * set `x-ms-client-flatten` to `false` in `arcSettings.json`, `clusters.json` and `extensions.json` * fix extensions --- .../azure-mgmt-azurestackhci/_meta.json | 4 +- .../azurestackhci/_azure_stack_hci_client.py | 8 +- .../mgmt/azurestackhci/_configuration.py | 2 +- .../azure/mgmt/azurestackhci/_metadata.json | 4 +- .../azure/mgmt/azurestackhci/_version.py | 2 +- .../aio/_azure_stack_hci_client.py | 8 +- .../mgmt/azurestackhci/aio/_configuration.py | 2 +- .../operations/_arc_settings_operations.py | 184 +++++++++- .../aio/operations/_clusters_operations.py | 237 ++++++++++++- .../aio/operations/_extensions_operations.py | 14 +- .../aio/operations/_operations.py | 4 +- .../mgmt/azurestackhci/models/__init__.py | 10 + .../mgmt/azurestackhci/models/_models_py3.py | 334 +++++++++++++++--- .../operations/_arc_settings_operations.py | 262 +++++++++++++- .../operations/_clusters_operations.py | 325 ++++++++++++++++- .../operations/_extensions_operations.py | 24 +- .../azurestackhci/operations/_operations.py | 6 +- 17 files changed, 1302 insertions(+), 128 deletions(-) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/_meta.json b/sdk/azurestackhci/azure-mgmt-azurestackhci/_meta.json index 038016cda203..c601c9c2c5e2 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/_meta.json +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/_meta.json @@ -4,8 +4,8 @@ "@autorest/python@5.12.0", "@autorest/modelerfour@4.19.3" ], - "commit": "4042a47cff72c950d35dd72149895b044ed79713", + "commit": "231bba87d82c8acd0b203ea3cbcd172209238ad9", "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/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", + "autorest_command": "autorest specification/azurestackhci/resource-manager/readme.md --multiapi --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.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 f487b24bfe19..dad002138479 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 @@ -25,13 +25,13 @@ class AzureStackHCIClient: """Azure Stack HCI management service. :ivar arc_settings: ArcSettingsOperations operations - :vartype arc_settings: azure_stack_hci_client.operations.ArcSettingsOperations + :vartype arc_settings: azure.mgmt.azurestackhci.operations.ArcSettingsOperations :ivar clusters: ClustersOperations operations - :vartype clusters: azure_stack_hci_client.operations.ClustersOperations + :vartype clusters: azure.mgmt.azurestackhci.operations.ClustersOperations :ivar extensions: ExtensionsOperations operations - :vartype extensions: azure_stack_hci_client.operations.ExtensionsOperations + :vartype extensions: azure.mgmt.azurestackhci.operations.ExtensionsOperations :ivar operations: Operations operations - :vartype operations: azure_stack_hci_client.operations.Operations + :vartype operations: azure.mgmt.azurestackhci.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. 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 f91f030c86b0..909c129d10ec 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_configuration.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_configuration.py @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2022-01-01" + self.api_version = "2022-03-01" 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 ee877386b9c7..cfe1ded3d41b 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": "2022-01-01", - "total_api_version_list": ["2022-01-01"], + "chosen_version": "2022-03-01", + "total_api_version_list": ["2022-03-01"], "client": { "name": "AzureStackHCIClient", "filename": "_azure_stack_hci_client", 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 92453d8691d9..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.1.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 496b23423324..2625a86fdc7d 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 @@ -25,13 +25,13 @@ class AzureStackHCIClient: """Azure Stack HCI management service. :ivar arc_settings: ArcSettingsOperations operations - :vartype arc_settings: azure_stack_hci_client.aio.operations.ArcSettingsOperations + :vartype arc_settings: azure.mgmt.azurestackhci.aio.operations.ArcSettingsOperations :ivar clusters: ClustersOperations operations - :vartype clusters: azure_stack_hci_client.aio.operations.ClustersOperations + :vartype clusters: azure.mgmt.azurestackhci.aio.operations.ClustersOperations :ivar extensions: ExtensionsOperations operations - :vartype extensions: azure_stack_hci_client.aio.operations.ExtensionsOperations + :vartype extensions: azure.mgmt.azurestackhci.aio.operations.ExtensionsOperations :ivar operations: Operations operations - :vartype operations: azure_stack_hci_client.aio.operations.Operations + :vartype operations: azure.mgmt.azurestackhci.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. 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 feb87a2cc13e..650a0c6e3cbc 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 = "2022-01-01" + self.api_version = "2022-03-01" 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/_arc_settings_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_arc_settings_operations.py index 854db0b3f1e7..b9e1acc9455e 100644 --- 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 @@ -22,7 +22,7 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._arc_settings_operations import build_create_request, build_delete_request_initial, build_get_request, build_list_by_cluster_request +from ...operations._arc_settings_operations import build_create_identity_request_initial, build_create_request, build_delete_request_initial, build_generate_password_request, build_get_request, build_list_by_cluster_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ArcSettingsOperations: 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 + :type models: ~azure.mgmt.azurestackhci.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -63,7 +63,8 @@ def list_by_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] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.ArcSettingList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ArcSettingList"] @@ -141,7 +142,7 @@ async def get( :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 + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ArcSetting"] @@ -198,10 +199,10 @@ async def create( 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 + :type arc_setting: ~azure.mgmt.azurestackhci.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 + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ArcSetting"] @@ -346,3 +347,174 @@ def get_long_running_output(pipeline_response): 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 + + @distributed_trace_async + async def generate_password( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + **kwargs: Any + ) -> "_models.PasswordCredential": + """Generate password for arc settings. + + :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: PasswordCredential, or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.PasswordCredential + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PasswordCredential"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_generate_password_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + template_url=self.generate_password.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PasswordCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + generate_password.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/generatePassword'} # type: ignore + + + async def _create_identity_initial( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + **kwargs: Any + ) -> Optional["_models.ArcIdentityResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ArcIdentityResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_create_identity_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + template_url=self._create_identity_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ArcIdentityResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_identity_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/createArcIdentity'} # type: ignore + + + @distributed_trace_async + async def begin_create_identity( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + **kwargs: Any + ) -> AsyncLROPoller["_models.ArcIdentityResponse"]: + """Create Aad identity for arc settings. + + :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 ArcIdentityResponse or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ArcIdentityResponse] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArcIdentityResponse"] + lro_delay = kwargs.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_identity_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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ArcIdentityResponse', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_identity.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/createArcIdentity'} # 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 08a8fb907973..f5dabcc33c06 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 @@ -6,21 +6,23 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +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 +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models from ..._vendor import _convert_request -from ...operations._clusters_operations import build_create_request, build_delete_request, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_update_request +from ...operations._clusters_operations import build_create_identity_request_initial, build_create_request, build_delete_request, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_update_request, build_upload_certificate_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -31,7 +33,7 @@ class ClustersOperations: 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 + :type models: ~azure.mgmt.azurestackhci.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -55,7 +57,7 @@ def list_by_subscription( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ClusterList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci_client.models.ClusterList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.ClusterList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterList"] @@ -122,7 +124,7 @@ def list_by_resource_group( :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ClusterList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci_client.models.ClusterList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.ClusterList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterList"] @@ -194,7 +196,7 @@ async def get( :type cluster_name: str :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 + :rtype: ~azure.mgmt.azurestackhci.models.Cluster :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] @@ -246,10 +248,10 @@ async def create( :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.Cluster + :type cluster: ~azure.mgmt.azurestackhci.models.Cluster :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 + :rtype: ~azure.mgmt.azurestackhci.models.Cluster :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] @@ -306,10 +308,10 @@ 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.ClusterPatch + :type cluster: ~azure.mgmt.azurestackhci.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 + :rtype: ~azure.mgmt.azurestackhci.models.Cluster :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] @@ -398,3 +400,218 @@ async def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}'} # type: ignore + + async def _upload_certificate_initial( + self, + resource_group_name: str, + cluster_name: str, + upload_certificate_request: "_models.UploadCertificateRequest", + **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', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(upload_certificate_request, 'UploadCertificateRequest') + + request = build_upload_certificate_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + content_type=content_type, + json=_json, + template_url=self._upload_certificate_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _upload_certificate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/uploadCertificate'} # type: ignore + + + @distributed_trace_async + async def begin_upload_certificate( + self, + resource_group_name: str, + cluster_name: str, + upload_certificate_request: "_models.UploadCertificateRequest", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Upload certificate. + + :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 upload_certificate_request: Upload certificate request. + :type upload_certificate_request: ~azure.mgmt.azurestackhci.models.UploadCertificateRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :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 + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.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._upload_certificate_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + upload_certificate_request=upload_certificate_request, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_upload_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/uploadCertificate'} # type: ignore + + async def _create_identity_initial( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> Optional["_models.ClusterIdentityResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ClusterIdentityResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_create_identity_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + template_url=self._create_identity_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ClusterIdentityResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_identity_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/createClusterIdentity'} # type: ignore + + + @distributed_trace_async + async def begin_create_identity( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> AsyncLROPoller["_models.ClusterIdentityResponse"]: + """Create cluster identity. + + :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 + :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 ClusterIdentityResponse or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ClusterIdentityResponse] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterIdentityResponse"] + lro_delay = kwargs.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_identity_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ClusterIdentityResponse', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_identity.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/createClusterIdentity'} # type: ignore 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 index 9ce4b9df0070..0dbe2851017b 100644 --- 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 @@ -33,7 +33,7 @@ class ExtensionsOperations: 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 + :type models: ~azure.mgmt.azurestackhci.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -67,7 +67,7 @@ def list_by_arc_setting( :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] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.ExtensionList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionList"] @@ -150,7 +150,7 @@ async def get( :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 + :rtype: ~azure.mgmt.azurestackhci.models.Extension :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] @@ -264,7 +264,7 @@ async def begin_create( :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 + :type extension: ~azure.mgmt.azurestackhci.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 @@ -275,7 +275,7 @@ async def begin_create( 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] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] :raises: ~azure.core.exceptions.HttpResponseError """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -393,7 +393,7 @@ async def begin_update( :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 + :type extension: ~azure.mgmt.azurestackhci.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 @@ -404,7 +404,7 @@ async def begin_update( 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] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] :raises: ~azure.core.exceptions.HttpResponseError """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] 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 c9ae2251e5be..eb54e5aff88a 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 @@ -29,7 +29,7 @@ class Operations: 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 + :type models: ~azure.mgmt.azurestackhci.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -53,7 +53,7 @@ async def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: OperationListResult, or the result of cls(response) - :rtype: ~azure_stack_hci_client.models.OperationListResult + :rtype: ~azure.mgmt.azurestackhci.models.OperationListResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] 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 8427ffcef4ae..e2100e043a24 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 @@ -6,10 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from ._models_py3 import ArcIdentityResponse from ._models_py3 import ArcSetting from ._models_py3 import ArcSettingList from ._models_py3 import Cluster from ._models_py3 import ClusterDesiredProperties +from ._models_py3 import ClusterIdentityResponse from ._models_py3 import ClusterList from ._models_py3 import ClusterNode from ._models_py3 import ClusterPatch @@ -22,11 +24,14 @@ from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationListResult +from ._models_py3 import PasswordCredential from ._models_py3 import PerNodeExtensionState from ._models_py3 import PerNodeState from ._models_py3 import ProxyResource +from ._models_py3 import RawCertificateData from ._models_py3 import Resource from ._models_py3 import TrackedResource +from ._models_py3 import UploadCertificateRequest from ._azure_stack_hci_client_enums import ( @@ -45,10 +50,12 @@ ) __all__ = [ + 'ArcIdentityResponse', 'ArcSetting', 'ArcSettingList', 'Cluster', 'ClusterDesiredProperties', + 'ClusterIdentityResponse', 'ClusterList', 'ClusterNode', 'ClusterPatch', @@ -61,11 +68,14 @@ 'Operation', 'OperationDisplay', 'OperationListResult', + 'PasswordCredential', 'PerNodeExtensionState', 'PerNodeState', 'ProxyResource', + 'RawCertificateData', 'Resource', 'TrackedResource', + 'UploadCertificateRequest', 'ActionType', 'ArcSettingAggregateState', 'CreatedByType', 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 5ecbb09293d3..7eb1f02a2ba2 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,6 +15,52 @@ from ._azure_stack_hci_client_enums import * +class ArcIdentityResponse(msrest.serialization.Model): + """ArcIdentity details. + + :ivar arc_application_client_id: + :vartype arc_application_client_id: str + :ivar arc_application_tenant_id: + :vartype arc_application_tenant_id: str + :ivar arc_service_principal_object_id: + :vartype arc_service_principal_object_id: str + :ivar arc_application_object_id: + :vartype arc_application_object_id: str + """ + + _attribute_map = { + 'arc_application_client_id': {'key': 'properties.arcApplicationClientId', 'type': 'str'}, + 'arc_application_tenant_id': {'key': 'properties.arcApplicationTenantId', 'type': 'str'}, + 'arc_service_principal_object_id': {'key': 'properties.arcServicePrincipalObjectId', 'type': 'str'}, + 'arc_application_object_id': {'key': 'properties.arcApplicationObjectId', 'type': 'str'}, + } + + def __init__( + self, + *, + arc_application_client_id: Optional[str] = None, + arc_application_tenant_id: Optional[str] = None, + arc_service_principal_object_id: Optional[str] = None, + arc_application_object_id: Optional[str] = None, + **kwargs + ): + """ + :keyword arc_application_client_id: + :paramtype arc_application_client_id: str + :keyword arc_application_tenant_id: + :paramtype arc_application_tenant_id: str + :keyword arc_service_principal_object_id: + :paramtype arc_service_principal_object_id: str + :keyword arc_application_object_id: + :paramtype arc_application_object_id: str + """ + super(ArcIdentityResponse, self).__init__(**kwargs) + self.arc_application_client_id = arc_application_client_id + self.arc_application_tenant_id = arc_application_tenant_id + self.arc_service_principal_object_id = arc_service_principal_object_id + self.arc_application_object_id = arc_application_object_id + + class Resource(msrest.serialization.Model): """Common fields that are returned in the response for all Azure Resource Manager resources. @@ -105,29 +151,37 @@ class ArcSetting(ProxyResource): :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 + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.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 arc_application_client_id: App id of arc AAD identity. + :vartype arc_application_client_id: str + :ivar arc_application_tenant_id: Tenant id of arc AAD identity. + :vartype arc_application_tenant_id: str + :ivar arc_service_principal_object_id: Object id of arc AAD service principal. + :vartype arc_service_principal_object_id: str + :ivar arc_application_object_id: Object id of arc AAD identity. + :vartype arc_application_object_id: 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 + :vartype aggregate_state: str or ~azure.mgmt.azurestackhci.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] + :vartype per_node_details: list[~azure.mgmt.azurestackhci.models.PerNodeState] :ivar created_by: The identity that created the resource. :vartype created_by: str :ivar created_by_type: The type of identity that created the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure_stack_hci_client.models.CreatedByType + :vartype created_by_type: str or ~azure.mgmt.azurestackhci.models.CreatedByType :ivar created_at: The timestamp of resource creation (UTC). :vartype created_at: ~datetime.datetime :ivar last_modified_by: The identity that last modified the resource. :vartype last_modified_by: str :ivar last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure_stack_hci_client.models.CreatedByType + :vartype last_modified_by_type: str or ~azure.mgmt.azurestackhci.models.CreatedByType :ivar last_modified_at: The timestamp of resource last modification (UTC). :vartype last_modified_at: ~datetime.datetime """ @@ -147,6 +201,10 @@ class ArcSetting(ProxyResource): 'type': {'key': 'type', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'arc_instance_resource_group': {'key': 'properties.arcInstanceResourceGroup', 'type': 'str'}, + 'arc_application_client_id': {'key': 'properties.arcApplicationClientId', 'type': 'str'}, + 'arc_application_tenant_id': {'key': 'properties.arcApplicationTenantId', 'type': 'str'}, + 'arc_service_principal_object_id': {'key': 'properties.arcServicePrincipalObjectId', 'type': 'str'}, + 'arc_application_object_id': {'key': 'properties.arcApplicationObjectId', 'type': 'str'}, 'aggregate_state': {'key': 'properties.aggregateState', 'type': 'str'}, 'per_node_details': {'key': 'properties.perNodeDetails', 'type': '[PerNodeState]'}, 'created_by': {'key': 'systemData.createdBy', 'type': 'str'}, @@ -161,6 +219,10 @@ def __init__( self, *, arc_instance_resource_group: Optional[str] = None, + arc_application_client_id: Optional[str] = None, + arc_application_tenant_id: Optional[str] = None, + arc_service_principal_object_id: Optional[str] = None, + arc_application_object_id: Optional[str] = None, created_by: Optional[str] = None, created_by_type: Optional[Union[str, "CreatedByType"]] = None, created_at: Optional[datetime.datetime] = None, @@ -173,24 +235,36 @@ def __init__( :keyword arc_instance_resource_group: The resource group that hosts the Arc agents, ie. Hybrid Compute Machine resources. :paramtype arc_instance_resource_group: str + :keyword arc_application_client_id: App id of arc AAD identity. + :paramtype arc_application_client_id: str + :keyword arc_application_tenant_id: Tenant id of arc AAD identity. + :paramtype arc_application_tenant_id: str + :keyword arc_service_principal_object_id: Object id of arc AAD service principal. + :paramtype arc_service_principal_object_id: str + :keyword arc_application_object_id: Object id of arc AAD identity. + :paramtype arc_application_object_id: str :keyword created_by: The identity that created the resource. :paramtype created_by: str :keyword created_by_type: The type of identity that created the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure_stack_hci_client.models.CreatedByType + :paramtype created_by_type: str or ~azure.mgmt.azurestackhci.models.CreatedByType :keyword created_at: The timestamp of resource creation (UTC). :paramtype created_at: ~datetime.datetime :keyword last_modified_by: The identity that last modified the resource. :paramtype last_modified_by: str :keyword last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or ~azure_stack_hci_client.models.CreatedByType + :paramtype last_modified_by_type: str or ~azure.mgmt.azurestackhci.models.CreatedByType :keyword last_modified_at: The timestamp of resource last modification (UTC). :paramtype last_modified_at: ~datetime.datetime """ super(ArcSetting, self).__init__(**kwargs) self.provisioning_state = None self.arc_instance_resource_group = arc_instance_resource_group + self.arc_application_client_id = arc_application_client_id + self.arc_application_tenant_id = arc_application_tenant_id + self.arc_service_principal_object_id = arc_service_principal_object_id + self.arc_application_object_id = arc_application_object_id self.aggregate_state = None self.per_node_details = None self.created_by = created_by @@ -207,7 +281,7 @@ class ArcSettingList(msrest.serialization.Model): 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] + :vartype value: list[~azure.mgmt.azurestackhci.models.ArcSetting] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -308,10 +382,10 @@ class Cluster(TrackedResource): :vartype location: str :ivar provisioning_state: Provisioning state. Possible values include: "Succeeded", "Failed", "Canceled", "Accepted", "Provisioning". - :vartype provisioning_state: str or ~azure_stack_hci_client.models.ProvisioningState + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState :ivar status: Status of the cluster agent. Possible values include: "NotYetRegistered", "ConnectedRecently", "NotConnectedRecently", "Disconnected", "Error". - :vartype status: str or ~azure_stack_hci_client.models.Status + :vartype status: str or ~azure.mgmt.azurestackhci.models.Status :ivar cloud_id: Unique, immutable resource id. :vartype cloud_id: str :ivar cloud_management_endpoint: Endpoint configured for management from the Azure portal. @@ -320,10 +394,14 @@ class Cluster(TrackedResource): :vartype aad_client_id: str :ivar aad_tenant_id: Tenant id of cluster AAD identity. :vartype aad_tenant_id: str + :ivar aad_application_object_id: Object id of cluster AAD identity. + :vartype aad_application_object_id: str + :ivar aad_service_principal_object_id: Id of cluster identity service principal. + :vartype aad_service_principal_object_id: str :ivar desired_properties: Desired properties of the cluster. - :vartype desired_properties: ~azure_stack_hci_client.models.ClusterDesiredProperties + :vartype desired_properties: ~azure.mgmt.azurestackhci.models.ClusterDesiredProperties :ivar reported_properties: Properties reported by cluster agent. - :vartype reported_properties: ~azure_stack_hci_client.models.ClusterReportedProperties + :vartype reported_properties: ~azure.mgmt.azurestackhci.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. @@ -334,18 +412,20 @@ class Cluster(TrackedResource): :vartype last_sync_timestamp: ~datetime.datetime :ivar last_billing_timestamp: Most recent billing meter timestamp. :vartype last_billing_timestamp: ~datetime.datetime + :ivar service_endpoint: Region specific DataPath Endpoint of the cluster. + :vartype service_endpoint: str :ivar created_by: The identity that created the resource. :vartype created_by: str :ivar created_by_type: The type of identity that created the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure_stack_hci_client.models.CreatedByType + :vartype created_by_type: str or ~azure.mgmt.azurestackhci.models.CreatedByType :ivar created_at: The timestamp of resource creation (UTC). :vartype created_at: ~datetime.datetime :ivar last_modified_by: The identity that last modified the resource. :vartype last_modified_by: str :ivar last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure_stack_hci_client.models.CreatedByType + :vartype last_modified_by_type: str or ~azure.mgmt.azurestackhci.models.CreatedByType :ivar last_modified_at: The timestamp of resource last modification (UTC). :vartype last_modified_at: ~datetime.datetime """ @@ -364,6 +444,7 @@ class Cluster(TrackedResource): 'registration_timestamp': {'readonly': True}, 'last_sync_timestamp': {'readonly': True}, 'last_billing_timestamp': {'readonly': True}, + 'service_endpoint': {'readonly': True}, } _attribute_map = { @@ -378,6 +459,8 @@ class Cluster(TrackedResource): 'cloud_management_endpoint': {'key': 'properties.cloudManagementEndpoint', 'type': 'str'}, 'aad_client_id': {'key': 'properties.aadClientId', 'type': 'str'}, 'aad_tenant_id': {'key': 'properties.aadTenantId', 'type': 'str'}, + 'aad_application_object_id': {'key': 'properties.aadApplicationObjectId', 'type': 'str'}, + 'aad_service_principal_object_id': {'key': 'properties.aadServicePrincipalObjectId', 'type': 'str'}, 'desired_properties': {'key': 'properties.desiredProperties', 'type': 'ClusterDesiredProperties'}, 'reported_properties': {'key': 'properties.reportedProperties', 'type': 'ClusterReportedProperties'}, 'trial_days_remaining': {'key': 'properties.trialDaysRemaining', 'type': 'float'}, @@ -385,6 +468,7 @@ class Cluster(TrackedResource): 'registration_timestamp': {'key': 'properties.registrationTimestamp', 'type': 'iso-8601'}, 'last_sync_timestamp': {'key': 'properties.lastSyncTimestamp', 'type': 'iso-8601'}, 'last_billing_timestamp': {'key': 'properties.lastBillingTimestamp', 'type': 'iso-8601'}, + 'service_endpoint': {'key': 'properties.serviceEndpoint', 'type': 'str'}, 'created_by': {'key': 'systemData.createdBy', 'type': 'str'}, 'created_by_type': {'key': 'systemData.createdByType', 'type': 'str'}, 'created_at': {'key': 'systemData.createdAt', 'type': 'iso-8601'}, @@ -401,6 +485,8 @@ def __init__( cloud_management_endpoint: Optional[str] = None, aad_client_id: Optional[str] = None, aad_tenant_id: Optional[str] = None, + aad_application_object_id: Optional[str] = None, + aad_service_principal_object_id: Optional[str] = None, desired_properties: Optional["ClusterDesiredProperties"] = None, created_by: Optional[str] = None, created_by_type: Optional[Union[str, "CreatedByType"]] = None, @@ -421,20 +507,24 @@ def __init__( :paramtype aad_client_id: str :keyword aad_tenant_id: Tenant id of cluster AAD identity. :paramtype aad_tenant_id: str + :keyword aad_application_object_id: Object id of cluster AAD identity. + :paramtype aad_application_object_id: str + :keyword aad_service_principal_object_id: Id of cluster identity service principal. + :paramtype aad_service_principal_object_id: str :keyword desired_properties: Desired properties of the cluster. - :paramtype desired_properties: ~azure_stack_hci_client.models.ClusterDesiredProperties + :paramtype desired_properties: ~azure.mgmt.azurestackhci.models.ClusterDesiredProperties :keyword created_by: The identity that created the resource. :paramtype created_by: str :keyword created_by_type: The type of identity that created the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure_stack_hci_client.models.CreatedByType + :paramtype created_by_type: str or ~azure.mgmt.azurestackhci.models.CreatedByType :keyword created_at: The timestamp of resource creation (UTC). :paramtype created_at: ~datetime.datetime :keyword last_modified_by: The identity that last modified the resource. :paramtype last_modified_by: str :keyword last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or ~azure_stack_hci_client.models.CreatedByType + :paramtype last_modified_by_type: str or ~azure.mgmt.azurestackhci.models.CreatedByType :keyword last_modified_at: The timestamp of resource last modification (UTC). :paramtype last_modified_at: ~datetime.datetime """ @@ -445,6 +535,8 @@ def __init__( self.cloud_management_endpoint = cloud_management_endpoint self.aad_client_id = aad_client_id self.aad_tenant_id = aad_tenant_id + self.aad_application_object_id = aad_application_object_id + self.aad_service_principal_object_id = aad_service_principal_object_id self.desired_properties = desired_properties self.reported_properties = None self.trial_days_remaining = None @@ -452,6 +544,7 @@ def __init__( self.registration_timestamp = None self.last_sync_timestamp = None self.last_billing_timestamp = None + self.service_endpoint = None self.created_by = created_by self.created_by_type = created_by_type self.created_at = created_at @@ -466,10 +559,10 @@ class ClusterDesiredProperties(msrest.serialization.Model): :ivar windows_server_subscription: Desired state of Windows Server Subscription. Possible values include: "Disabled", "Enabled". :vartype windows_server_subscription: str or - ~azure_stack_hci_client.models.WindowsServerSubscription + ~azure.mgmt.azurestackhci.models.WindowsServerSubscription :ivar diagnostic_level: Desired level of diagnostic data emitted by the cluster. Possible values include: "Off", "Basic", "Enhanced". - :vartype diagnostic_level: str or ~azure_stack_hci_client.models.DiagnosticLevel + :vartype diagnostic_level: str or ~azure.mgmt.azurestackhci.models.DiagnosticLevel """ _attribute_map = { @@ -488,23 +581,69 @@ def __init__( :keyword windows_server_subscription: Desired state of Windows Server Subscription. Possible values include: "Disabled", "Enabled". :paramtype windows_server_subscription: str or - ~azure_stack_hci_client.models.WindowsServerSubscription + ~azure.mgmt.azurestackhci.models.WindowsServerSubscription :keyword diagnostic_level: Desired level of diagnostic data emitted by the cluster. Possible values include: "Off", "Basic", "Enhanced". - :paramtype diagnostic_level: str or ~azure_stack_hci_client.models.DiagnosticLevel + :paramtype diagnostic_level: str or ~azure.mgmt.azurestackhci.models.DiagnosticLevel """ super(ClusterDesiredProperties, self).__init__(**kwargs) self.windows_server_subscription = windows_server_subscription self.diagnostic_level = diagnostic_level +class ClusterIdentityResponse(msrest.serialization.Model): + """Cluster Identity details. + + :ivar aad_client_id: + :vartype aad_client_id: str + :ivar aad_tenant_id: + :vartype aad_tenant_id: str + :ivar aad_service_principal_object_id: + :vartype aad_service_principal_object_id: str + :ivar aad_application_object_id: + :vartype aad_application_object_id: str + """ + + _attribute_map = { + 'aad_client_id': {'key': 'properties.aadClientId', 'type': 'str'}, + 'aad_tenant_id': {'key': 'properties.aadTenantId', 'type': 'str'}, + 'aad_service_principal_object_id': {'key': 'properties.aadServicePrincipalObjectId', 'type': 'str'}, + 'aad_application_object_id': {'key': 'properties.aadApplicationObjectId', 'type': 'str'}, + } + + def __init__( + self, + *, + aad_client_id: Optional[str] = None, + aad_tenant_id: Optional[str] = None, + aad_service_principal_object_id: Optional[str] = None, + aad_application_object_id: Optional[str] = None, + **kwargs + ): + """ + :keyword aad_client_id: + :paramtype aad_client_id: str + :keyword aad_tenant_id: + :paramtype aad_tenant_id: str + :keyword aad_service_principal_object_id: + :paramtype aad_service_principal_object_id: str + :keyword aad_application_object_id: + :paramtype aad_application_object_id: str + """ + super(ClusterIdentityResponse, self).__init__(**kwargs) + self.aad_client_id = aad_client_id + self.aad_tenant_id = aad_tenant_id + self.aad_service_principal_object_id = aad_service_principal_object_id + self.aad_application_object_id = aad_application_object_id + + class ClusterList(msrest.serialization.Model): """List of clusters. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of clusters. - :vartype value: list[~azure_stack_hci_client.models.Cluster] + :vartype value: list[~azure.mgmt.azurestackhci.models.Cluster] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -526,7 +665,7 @@ def __init__( ): """ :keyword value: List of clusters. - :paramtype value: list[~azure_stack_hci_client.models.Cluster] + :paramtype value: list[~azure.mgmt.azurestackhci.models.Cluster] """ super(ClusterList, self).__init__(**kwargs) self.value = value @@ -545,7 +684,7 @@ class ClusterNode(msrest.serialization.Model): :ivar windows_server_subscription: State of Windows Server Subscription. Possible values include: "Disabled", "Enabled". :vartype windows_server_subscription: str or - ~azure_stack_hci_client.models.WindowsServerSubscription + ~azure.mgmt.azurestackhci.models.WindowsServerSubscription :ivar manufacturer: Manufacturer of the cluster node hardware. :vartype manufacturer: str :ivar model: Model name of the cluster node hardware. @@ -619,7 +758,7 @@ class ClusterPatch(msrest.serialization.Model): :ivar aad_tenant_id: Tenant id of cluster AAD identity. :vartype aad_tenant_id: str :ivar desired_properties: Desired properties of the cluster. - :vartype desired_properties: ~azure_stack_hci_client.models.ClusterDesiredProperties + :vartype desired_properties: ~azure.mgmt.azurestackhci.models.ClusterDesiredProperties """ _attribute_map = { @@ -650,7 +789,7 @@ def __init__( :keyword aad_tenant_id: Tenant id of cluster AAD identity. :paramtype aad_tenant_id: str :keyword desired_properties: Desired properties of the cluster. - :paramtype desired_properties: ~azure_stack_hci_client.models.ClusterDesiredProperties + :paramtype desired_properties: ~azure.mgmt.azurestackhci.models.ClusterDesiredProperties """ super(ClusterPatch, self).__init__(**kwargs) self.tags = tags @@ -672,15 +811,15 @@ class ClusterReportedProperties(msrest.serialization.Model): :ivar cluster_version: Version of the cluster software. :vartype cluster_version: str :ivar nodes: List of nodes reported by the cluster. - :vartype nodes: list[~azure_stack_hci_client.models.ClusterNode] + :vartype nodes: list[~azure.mgmt.azurestackhci.models.ClusterNode] :ivar last_updated: Last time the cluster reported the data. :vartype last_updated: ~datetime.datetime :ivar imds_attestation: IMDS attestation status of the cluster. Possible values include: "Disabled", "Enabled". - :vartype imds_attestation: str or ~azure_stack_hci_client.models.ImdsAttestation + :vartype imds_attestation: str or ~azure.mgmt.azurestackhci.models.ImdsAttestation :ivar diagnostic_level: Level of diagnostic data emitted by the cluster. Possible values include: "Off", "Basic", "Enhanced". - :vartype diagnostic_level: str or ~azure_stack_hci_client.models.DiagnosticLevel + :vartype diagnostic_level: str or ~azure.mgmt.azurestackhci.models.DiagnosticLevel """ _validation = { @@ -711,7 +850,7 @@ def __init__( """ :keyword diagnostic_level: Level of diagnostic data emitted by the cluster. Possible values include: "Off", "Basic", "Enhanced". - :paramtype diagnostic_level: str or ~azure_stack_hci_client.models.DiagnosticLevel + :paramtype diagnostic_level: str or ~azure.mgmt.azurestackhci.models.DiagnosticLevel """ super(ClusterReportedProperties, self).__init__(**kwargs) self.cluster_name = None @@ -767,9 +906,9 @@ class ErrorDetail(msrest.serialization.Model): :ivar target: The error target. :vartype target: str :ivar details: The error details. - :vartype details: list[~azure_stack_hci_client.models.ErrorDetail] + :vartype details: list[~azure.mgmt.azurestackhci.models.ErrorDetail] :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure_stack_hci_client.models.ErrorAdditionalInfo] + :vartype additional_info: list[~azure.mgmt.azurestackhci.models.ErrorAdditionalInfo] """ _validation = { @@ -806,7 +945,7 @@ class ErrorResponse(msrest.serialization.Model): """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). :ivar error: The error object. - :vartype error: ~azure_stack_hci_client.models.ErrorDetail + :vartype error: ~azure.mgmt.azurestackhci.models.ErrorDetail """ _attribute_map = { @@ -821,7 +960,7 @@ def __init__( ): """ :keyword error: The error object. - :paramtype error: ~azure_stack_hci_client.models.ErrorDetail + :paramtype error: ~azure.mgmt.azurestackhci.models.ErrorDetail """ super(ErrorResponse, self).__init__(**kwargs) self.error = error @@ -842,14 +981,15 @@ class Extension(ProxyResource): :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 + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.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 + :vartype aggregate_state: str or ~azure.mgmt.azurestackhci.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] + :vartype per_node_extension_details: + list[~azure.mgmt.azurestackhci.models.PerNodeExtensionState] :ivar force_update_tag: How the extension handler should be forced to update even if the extension configuration has not changed. :vartype force_update_tag: str @@ -872,14 +1012,14 @@ class Extension(ProxyResource): :vartype created_by: str :ivar created_by_type: The type of identity that created the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~azure_stack_hci_client.models.CreatedByType + :vartype created_by_type: str or ~azure.mgmt.azurestackhci.models.CreatedByType :ivar created_at: The timestamp of resource creation (UTC). :vartype created_at: ~datetime.datetime :ivar last_modified_by: The identity that last modified the resource. :vartype last_modified_by: str :ivar last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~azure_stack_hci_client.models.CreatedByType + :vartype last_modified_by_type: str or ~azure.mgmt.azurestackhci.models.CreatedByType :ivar last_modified_at: The timestamp of resource last modification (UTC). :vartype last_modified_at: ~datetime.datetime """ @@ -956,14 +1096,14 @@ def __init__( :paramtype created_by: str :keyword created_by_type: The type of identity that created the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~azure_stack_hci_client.models.CreatedByType + :paramtype created_by_type: str or ~azure.mgmt.azurestackhci.models.CreatedByType :keyword created_at: The timestamp of resource creation (UTC). :paramtype created_at: ~datetime.datetime :keyword last_modified_by: The identity that last modified the resource. :paramtype last_modified_by: str :keyword last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or ~azure_stack_hci_client.models.CreatedByType + :paramtype last_modified_by_type: str or ~azure.mgmt.azurestackhci.models.CreatedByType :keyword last_modified_at: The timestamp of resource last modification (UTC). :paramtype last_modified_at: ~datetime.datetime """ @@ -992,7 +1132,7 @@ class ExtensionList(msrest.serialization.Model): 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] + :vartype value: list[~azure.mgmt.azurestackhci.models.Extension] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -1030,14 +1170,14 @@ class Operation(msrest.serialization.Model): data-plane operations and "false" for ARM/control-plane operations. :vartype is_data_action: bool :ivar display: Localized display information for this particular operation. - :vartype display: ~azure_stack_hci_client.models.OperationDisplay + :vartype display: ~azure.mgmt.azurestackhci.models.OperationDisplay :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 + :vartype origin: str or ~azure.mgmt.azurestackhci.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 + :vartype action_type: str or ~azure.mgmt.azurestackhci.models.ActionType """ _validation = { @@ -1063,7 +1203,7 @@ def __init__( ): """ :keyword display: Localized display information for this particular operation. - :paramtype display: ~azure_stack_hci_client.models.OperationDisplay + :paramtype display: ~azure.mgmt.azurestackhci.models.OperationDisplay """ super(Operation, self).__init__(**kwargs) self.name = None @@ -1125,7 +1265,7 @@ class OperationListResult(msrest.serialization.Model): 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] + :vartype value: list[~azure.mgmt.azurestackhci.models.Operation] :ivar next_link: URL to get the next set of operation list results (if there are any). :vartype next_link: str """ @@ -1151,6 +1291,52 @@ def __init__( self.next_link = None +class PasswordCredential(msrest.serialization.Model): + """PasswordCredential. + + :ivar secret_text: + :vartype secret_text: str + :ivar key_id: + :vartype key_id: str + :ivar start_date_time: + :vartype start_date_time: ~datetime.datetime + :ivar end_date_time: + :vartype end_date_time: ~datetime.datetime + """ + + _attribute_map = { + 'secret_text': {'key': 'secretText', 'type': 'str'}, + 'key_id': {'key': 'keyId', 'type': 'str'}, + 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, + 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + secret_text: Optional[str] = None, + key_id: Optional[str] = None, + start_date_time: Optional[datetime.datetime] = None, + end_date_time: Optional[datetime.datetime] = None, + **kwargs + ): + """ + :keyword secret_text: + :paramtype secret_text: str + :keyword key_id: + :paramtype key_id: str + :keyword start_date_time: + :paramtype start_date_time: ~datetime.datetime + :keyword end_date_time: + :paramtype end_date_time: ~datetime.datetime + """ + super(PasswordCredential, self).__init__(**kwargs) + self.secret_text = secret_text + self.key_id = key_id + self.start_date_time = start_date_time + self.end_date_time = end_date_time + + class PerNodeExtensionState(msrest.serialization.Model): """Status of Arc Extension for a particular node in HCI Cluster. @@ -1163,7 +1349,7 @@ class PerNodeExtensionState(msrest.serialization.Model): :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 + :vartype state: str or ~azure.mgmt.azurestackhci.models.NodeExtensionState """ _validation = { @@ -1202,7 +1388,7 @@ class PerNodeState(msrest.serialization.Model): :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 + :vartype state: str or ~azure.mgmt.azurestackhci.models.NodeArcState """ _validation = { @@ -1227,3 +1413,53 @@ def __init__( self.name = None self.arc_instance = None self.state = None + + +class RawCertificateData(msrest.serialization.Model): + """RawCertificateData. + + :ivar certificates: + :vartype certificates: list[str] + """ + + _attribute_map = { + 'certificates': {'key': 'certificates', 'type': '[str]'}, + } + + def __init__( + self, + *, + certificates: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword certificates: + :paramtype certificates: list[str] + """ + super(RawCertificateData, self).__init__(**kwargs) + self.certificates = certificates + + +class UploadCertificateRequest(msrest.serialization.Model): + """UploadCertificateRequest. + + :ivar properties: + :vartype properties: ~azure.mgmt.azurestackhci.models.RawCertificateData + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'RawCertificateData'}, + } + + def __init__( + self, + *, + properties: Optional["RawCertificateData"] = None, + **kwargs + ): + """ + :keyword properties: + :paramtype properties: ~azure.mgmt.azurestackhci.models.RawCertificateData + """ + super(UploadCertificateRequest, self).__init__(**kwargs) + self.properties = properties 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 index 7ab5b3237a34..dc395fde0e59 100644 --- 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 @@ -35,7 +35,7 @@ def build_list_by_cluster_request( cluster_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings') @@ -71,7 +71,7 @@ def build_get_request( arc_setting_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}') @@ -113,7 +113,7 @@ def build_create_request( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-01-01" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}') @@ -154,7 +154,7 @@ def build_delete_request_initial( arc_setting_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}') @@ -183,6 +183,80 @@ def build_delete_request_initial( **kwargs ) + +def build_generate_password_request( + subscription_id: str, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/generatePassword') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_identity_request_initial( + subscription_id: str, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/createArcIdentity') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + class ArcSettingsOperations(object): """ArcSettingsOperations operations. @@ -190,7 +264,7 @@ class ArcSettingsOperations(object): 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 + :type models: ~azure.mgmt.azurestackhci.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -220,7 +294,7 @@ def list_by_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] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.ArcSettingList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ArcSettingList"] @@ -298,7 +372,7 @@ def get( :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 + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ArcSetting"] @@ -355,10 +429,10 @@ def create( 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 + :type arc_setting: ~azure.mgmt.azurestackhci.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 + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ArcSetting"] @@ -503,3 +577,173 @@ def get_long_running_output(pipeline_response): 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 + + @distributed_trace + def generate_password( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + **kwargs: Any + ) -> "_models.PasswordCredential": + """Generate password for arc settings. + + :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: PasswordCredential, or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.PasswordCredential + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PasswordCredential"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_generate_password_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + template_url=self.generate_password.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PasswordCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + generate_password.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/generatePassword'} # type: ignore + + + def _create_identity_initial( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + **kwargs: Any + ) -> Optional["_models.ArcIdentityResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ArcIdentityResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_create_identity_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + template_url=self._create_identity_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ArcIdentityResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_identity_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/createArcIdentity'} # type: ignore + + + @distributed_trace + def begin_create_identity( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + **kwargs: Any + ) -> LROPoller["_models.ArcIdentityResponse"]: + """Create Aad identity for arc settings. + + :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 ArcIdentityResponse or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ArcIdentityResponse] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArcIdentityResponse"] + lro_delay = kwargs.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_identity_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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ArcIdentityResponse', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_identity.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/createArcIdentity'} # 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 0f46242f198e..159cee2b22cc 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 @@ -6,16 +6,18 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union 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 HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from msrest import Serializer from .. import models as _models @@ -31,7 +33,7 @@ def build_list_by_subscription_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/clusters') @@ -63,7 +65,7 @@ def build_list_by_resource_group_request( resource_group_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters') @@ -97,7 +99,7 @@ def build_get_request( cluster_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}') @@ -137,7 +139,7 @@ def build_create_request( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-01-01" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}') @@ -181,7 +183,7 @@ def build_update_request( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-01-01" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}') @@ -220,7 +222,7 @@ def build_delete_request( cluster_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}') @@ -248,6 +250,85 @@ def build_delete_request( **kwargs ) + +def build_upload_certificate_request_initial( + subscription_id: str, + resource_group_name: str, + cluster_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/uploadCertificate') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_create_identity_request_initial( + subscription_id: str, + resource_group_name: str, + cluster_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/createClusterIdentity') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + class ClustersOperations(object): """ClustersOperations operations. @@ -255,7 +336,7 @@ class ClustersOperations(object): 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 + :type models: ~azure.mgmt.azurestackhci.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -279,7 +360,7 @@ def list_by_subscription( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ClusterList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure_stack_hci_client.models.ClusterList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.ClusterList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterList"] @@ -346,7 +427,7 @@ def list_by_resource_group( :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ClusterList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure_stack_hci_client.models.ClusterList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.ClusterList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterList"] @@ -418,7 +499,7 @@ def get( :type cluster_name: str :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 + :rtype: ~azure.mgmt.azurestackhci.models.Cluster :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] @@ -470,10 +551,10 @@ def create( :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.Cluster + :type cluster: ~azure.mgmt.azurestackhci.models.Cluster :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 + :rtype: ~azure.mgmt.azurestackhci.models.Cluster :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] @@ -530,10 +611,10 @@ 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.ClusterPatch + :type cluster: ~azure.mgmt.azurestackhci.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 + :rtype: ~azure.mgmt.azurestackhci.models.Cluster :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] @@ -622,3 +703,217 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}'} # type: ignore + + def _upload_certificate_initial( + self, + resource_group_name: str, + cluster_name: str, + upload_certificate_request: "_models.UploadCertificateRequest", + **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', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(upload_certificate_request, 'UploadCertificateRequest') + + request = build_upload_certificate_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + content_type=content_type, + json=_json, + template_url=self._upload_certificate_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _upload_certificate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/uploadCertificate'} # type: ignore + + + @distributed_trace + def begin_upload_certificate( + self, + resource_group_name: str, + cluster_name: str, + upload_certificate_request: "_models.UploadCertificateRequest", + **kwargs: Any + ) -> LROPoller[None]: + """Upload certificate. + + :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 upload_certificate_request: Upload certificate request. + :type upload_certificate_request: ~azure.mgmt.azurestackhci.models.UploadCertificateRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :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 + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.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._upload_certificate_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + upload_certificate_request=upload_certificate_request, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_upload_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/uploadCertificate'} # type: ignore + + def _create_identity_initial( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> Optional["_models.ClusterIdentityResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ClusterIdentityResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_create_identity_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + template_url=self._create_identity_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ClusterIdentityResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_identity_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/createClusterIdentity'} # type: ignore + + + @distributed_trace + def begin_create_identity( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> LROPoller["_models.ClusterIdentityResponse"]: + """Create cluster identity. + + :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 + :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 ClusterIdentityResponse or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ClusterIdentityResponse] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterIdentityResponse"] + lro_delay = kwargs.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_identity_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ClusterIdentityResponse', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_identity.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/createClusterIdentity'} # type: ignore 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 index 253e196f81b0..23f1136f1287 100644 --- 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 @@ -36,7 +36,7 @@ def build_list_by_arc_setting_request( arc_setting_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions') @@ -74,7 +74,7 @@ def build_get_request( extension_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}') @@ -118,7 +118,7 @@ def build_create_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-01-01" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}') @@ -166,7 +166,7 @@ def build_update_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-01-01" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}') @@ -209,7 +209,7 @@ def build_delete_request_initial( extension_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}') @@ -246,7 +246,7 @@ class ExtensionsOperations(object): 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 + :type models: ~azure.mgmt.azurestackhci.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -280,7 +280,7 @@ def list_by_arc_setting( :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] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.ExtensionList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionList"] @@ -363,7 +363,7 @@ def get( :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 + :rtype: ~azure.mgmt.azurestackhci.models.Extension :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] @@ -477,7 +477,7 @@ def begin_create( :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 + :type extension: ~azure.mgmt.azurestackhci.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 @@ -487,7 +487,7 @@ def begin_create( :keyword int polling_interval: 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] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] :raises: ~azure.core.exceptions.HttpResponseError """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -605,7 +605,7 @@ def begin_update( :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 + :type extension: ~azure.mgmt.azurestackhci.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 @@ -615,7 +615,7 @@ def begin_update( :keyword int polling_interval: 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] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] :raises: ~azure.core.exceptions.HttpResponseError """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] 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 e1fdc6e61f45..f460ecf47053 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 @@ -28,7 +28,7 @@ def build_list_request( **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/providers/Microsoft.AzureStackHCI/operations') @@ -56,7 +56,7 @@ class Operations(object): 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 + :type models: ~azure.mgmt.azurestackhci.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -80,7 +80,7 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: OperationListResult, or the result of cls(response) - :rtype: ~azure_stack_hci_client.models.OperationListResult + :rtype: ~azure.mgmt.azurestackhci.models.OperationListResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"]