Skip to content

Commit db2ad9f

Browse files
author
SDKAuto
committed
CodeGen from PR 18641 in Azure/azure-rest-api-specs
Merge 5d27f5b1d426c6174faf1fce8d573569aa3b0a70 into 8c0ae6e65256053949184780694e92a4c4aac6d7
1 parent 827028d commit db2ad9f

17 files changed

+1302
-128
lines changed

sdk/azurestackhci/azure-mgmt-azurestackhci/_meta.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"@autorest/python@5.12.0",
55
"@autorest/modelerfour@4.19.3"
66
],
7-
"commit": "4042a47cff72c950d35dd72149895b044ed79713",
7+
"commit": "231784c2e4d1eb87f6e857059e1079f9d1d8a7f5",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"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",
9+
"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",
1010
"readme": "specification/azurestackhci/resource-manager/readme.md"
1111
}

sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_azure_stack_hci_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ class AzureStackHCIClient:
2525
"""Azure Stack HCI management service.
2626
2727
:ivar arc_settings: ArcSettingsOperations operations
28-
:vartype arc_settings: azure_stack_hci_client.operations.ArcSettingsOperations
28+
:vartype arc_settings: azure.mgmt.azurestackhci.operations.ArcSettingsOperations
2929
:ivar clusters: ClustersOperations operations
30-
:vartype clusters: azure_stack_hci_client.operations.ClustersOperations
30+
:vartype clusters: azure.mgmt.azurestackhci.operations.ClustersOperations
3131
:ivar extensions: ExtensionsOperations operations
32-
:vartype extensions: azure_stack_hci_client.operations.ExtensionsOperations
32+
:vartype extensions: azure.mgmt.azurestackhci.operations.ExtensionsOperations
3333
:ivar operations: Operations operations
34-
:vartype operations: azure_stack_hci_client.operations.Operations
34+
:vartype operations: azure.mgmt.azurestackhci.operations.Operations
3535
:param credential: Credential needed for the client to connect to Azure.
3636
:type credential: ~azure.core.credentials.TokenCredential
3737
:param subscription_id: The ID of the target subscription.

sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(
4545

4646
self.credential = credential
4747
self.subscription_id = subscription_id
48-
self.api_version = "2022-01-01"
48+
self.api_version = "2022-03-01"
4949
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5050
kwargs.setdefault('sdk_moniker', 'mgmt-azurestackhci/{}'.format(VERSION))
5151
self._configure(**kwargs)

sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"chosen_version": "2022-01-01",
3-
"total_api_version_list": ["2022-01-01"],
2+
"chosen_version": "2022-03-01",
3+
"total_api_version_list": ["2022-03-01"],
44
"client": {
55
"name": "AzureStackHCIClient",
66
"filename": "_azure_stack_hci_client",

sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "6.1.0"
9+
VERSION = "1.0.0b1"

sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_azure_stack_hci_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ class AzureStackHCIClient:
2525
"""Azure Stack HCI management service.
2626
2727
:ivar arc_settings: ArcSettingsOperations operations
28-
:vartype arc_settings: azure_stack_hci_client.aio.operations.ArcSettingsOperations
28+
:vartype arc_settings: azure.mgmt.azurestackhci.aio.operations.ArcSettingsOperations
2929
:ivar clusters: ClustersOperations operations
30-
:vartype clusters: azure_stack_hci_client.aio.operations.ClustersOperations
30+
:vartype clusters: azure.mgmt.azurestackhci.aio.operations.ClustersOperations
3131
:ivar extensions: ExtensionsOperations operations
32-
:vartype extensions: azure_stack_hci_client.aio.operations.ExtensionsOperations
32+
:vartype extensions: azure.mgmt.azurestackhci.aio.operations.ExtensionsOperations
3333
:ivar operations: Operations operations
34-
:vartype operations: azure_stack_hci_client.aio.operations.Operations
34+
:vartype operations: azure.mgmt.azurestackhci.aio.operations.Operations
3535
:param credential: Credential needed for the client to connect to Azure.
3636
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
3737
:param subscription_id: The ID of the target subscription.

sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(
4545

4646
self.credential = credential
4747
self.subscription_id = subscription_id
48-
self.api_version = "2022-01-01"
48+
self.api_version = "2022-03-01"
4949
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5050
kwargs.setdefault('sdk_moniker', 'mgmt-azurestackhci/{}'.format(VERSION))
5151
self._configure(**kwargs)

sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_arc_settings_operations.py

Lines changed: 178 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
from ... import models as _models
2424
from ..._vendor import _convert_request
25-
from ...operations._arc_settings_operations import build_create_request, build_delete_request_initial, build_get_request, build_list_by_cluster_request
25+
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
2626
T = TypeVar('T')
2727
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
2828

@@ -33,7 +33,7 @@ class ArcSettingsOperations:
3333
instantiates it for you and attaches it as an attribute.
3434
3535
:ivar models: Alias to model classes used in this operation group.
36-
:type models: ~azure_stack_hci_client.models
36+
:type models: ~azure.mgmt.azurestackhci.models
3737
:param client: Client for service requests.
3838
:param config: Configuration of service client.
3939
:param serializer: An object model serializer.
@@ -63,7 +63,8 @@ def list_by_cluster(
6363
:type cluster_name: str
6464
:keyword callable cls: A custom type or function that will be passed the direct response
6565
:return: An iterator like instance of either ArcSettingList or the result of cls(response)
66-
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_stack_hci_client.models.ArcSettingList]
66+
:rtype:
67+
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.ArcSettingList]
6768
:raises: ~azure.core.exceptions.HttpResponseError
6869
"""
6970
cls = kwargs.pop('cls', None) # type: ClsType["_models.ArcSettingList"]
@@ -141,7 +142,7 @@ async def get(
141142
:type arc_setting_name: str
142143
:keyword callable cls: A custom type or function that will be passed the direct response
143144
:return: ArcSetting, or the result of cls(response)
144-
:rtype: ~azure_stack_hci_client.models.ArcSetting
145+
:rtype: ~azure.mgmt.azurestackhci.models.ArcSetting
145146
:raises: ~azure.core.exceptions.HttpResponseError
146147
"""
147148
cls = kwargs.pop('cls', None) # type: ClsType["_models.ArcSetting"]
@@ -198,10 +199,10 @@ async def create(
198199
information.
199200
:type arc_setting_name: str
200201
:param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster.
201-
:type arc_setting: ~azure_stack_hci_client.models.ArcSetting
202+
:type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSetting
202203
:keyword callable cls: A custom type or function that will be passed the direct response
203204
:return: ArcSetting, or the result of cls(response)
204-
:rtype: ~azure_stack_hci_client.models.ArcSetting
205+
:rtype: ~azure.mgmt.azurestackhci.models.ArcSetting
205206
:raises: ~azure.core.exceptions.HttpResponseError
206207
"""
207208
cls = kwargs.pop('cls', None) # type: ClsType["_models.ArcSetting"]
@@ -346,3 +347,174 @@ def get_long_running_output(pipeline_response):
346347
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
347348

348349
begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}'} # type: ignore
350+
351+
@distributed_trace_async
352+
async def generate_password(
353+
self,
354+
resource_group_name: str,
355+
cluster_name: str,
356+
arc_setting_name: str,
357+
**kwargs: Any
358+
) -> "_models.PasswordCredential":
359+
"""Generate password for arc settings.
360+
361+
:param resource_group_name: The name of the resource group. The name is case insensitive.
362+
:type resource_group_name: str
363+
:param cluster_name: The name of the cluster.
364+
:type cluster_name: str
365+
:param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting
366+
information.
367+
:type arc_setting_name: str
368+
:keyword callable cls: A custom type or function that will be passed the direct response
369+
:return: PasswordCredential, or the result of cls(response)
370+
:rtype: ~azure.mgmt.azurestackhci.models.PasswordCredential
371+
:raises: ~azure.core.exceptions.HttpResponseError
372+
"""
373+
cls = kwargs.pop('cls', None) # type: ClsType["_models.PasswordCredential"]
374+
error_map = {
375+
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
376+
}
377+
error_map.update(kwargs.pop('error_map', {}))
378+
379+
380+
request = build_generate_password_request(
381+
subscription_id=self._config.subscription_id,
382+
resource_group_name=resource_group_name,
383+
cluster_name=cluster_name,
384+
arc_setting_name=arc_setting_name,
385+
template_url=self.generate_password.metadata['url'],
386+
)
387+
request = _convert_request(request)
388+
request.url = self._client.format_url(request.url)
389+
390+
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
391+
response = pipeline_response.http_response
392+
393+
if response.status_code not in [200]:
394+
map_error(status_code=response.status_code, response=response, error_map=error_map)
395+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
396+
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
397+
398+
deserialized = self._deserialize('PasswordCredential', pipeline_response)
399+
400+
if cls:
401+
return cls(pipeline_response, deserialized, {})
402+
403+
return deserialized
404+
405+
generate_password.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/generatePassword'} # type: ignore
406+
407+
408+
async def _create_identity_initial(
409+
self,
410+
resource_group_name: str,
411+
cluster_name: str,
412+
arc_setting_name: str,
413+
**kwargs: Any
414+
) -> Optional["_models.ArcIdentityResponse"]:
415+
cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ArcIdentityResponse"]]
416+
error_map = {
417+
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
418+
}
419+
error_map.update(kwargs.pop('error_map', {}))
420+
421+
422+
request = build_create_identity_request_initial(
423+
subscription_id=self._config.subscription_id,
424+
resource_group_name=resource_group_name,
425+
cluster_name=cluster_name,
426+
arc_setting_name=arc_setting_name,
427+
template_url=self._create_identity_initial.metadata['url'],
428+
)
429+
request = _convert_request(request)
430+
request.url = self._client.format_url(request.url)
431+
432+
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
433+
response = pipeline_response.http_response
434+
435+
if response.status_code not in [200, 202]:
436+
map_error(status_code=response.status_code, response=response, error_map=error_map)
437+
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
438+
439+
deserialized = None
440+
if response.status_code == 200:
441+
deserialized = self._deserialize('ArcIdentityResponse', pipeline_response)
442+
443+
if cls:
444+
return cls(pipeline_response, deserialized, {})
445+
446+
return deserialized
447+
448+
_create_identity_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/createArcIdentity'} # type: ignore
449+
450+
451+
@distributed_trace_async
452+
async def begin_create_identity(
453+
self,
454+
resource_group_name: str,
455+
cluster_name: str,
456+
arc_setting_name: str,
457+
**kwargs: Any
458+
) -> AsyncLROPoller["_models.ArcIdentityResponse"]:
459+
"""Create Aad identity for arc settings.
460+
461+
:param resource_group_name: The name of the resource group. The name is case insensitive.
462+
:type resource_group_name: str
463+
:param cluster_name: The name of the cluster.
464+
:type cluster_name: str
465+
:param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting
466+
information.
467+
:type arc_setting_name: str
468+
:keyword callable cls: A custom type or function that will be passed the direct response
469+
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
470+
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
471+
this operation to not poll, or pass in your own initialized polling object for a personal
472+
polling strategy.
473+
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
474+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
475+
Retry-After header is present.
476+
:return: An instance of AsyncLROPoller that returns either ArcIdentityResponse or the result of
477+
cls(response)
478+
:rtype:
479+
~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ArcIdentityResponse]
480+
:raises: ~azure.core.exceptions.HttpResponseError
481+
"""
482+
polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod]
483+
cls = kwargs.pop('cls', None) # type: ClsType["_models.ArcIdentityResponse"]
484+
lro_delay = kwargs.pop(
485+
'polling_interval',
486+
self._config.polling_interval
487+
)
488+
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
489+
if cont_token is None:
490+
raw_result = await self._create_identity_initial(
491+
resource_group_name=resource_group_name,
492+
cluster_name=cluster_name,
493+
arc_setting_name=arc_setting_name,
494+
cls=lambda x,y,z: x,
495+
**kwargs
496+
)
497+
kwargs.pop('error_map', None)
498+
499+
def get_long_running_output(pipeline_response):
500+
response = pipeline_response.http_response
501+
deserialized = self._deserialize('ArcIdentityResponse', pipeline_response)
502+
if cls:
503+
return cls(pipeline_response, deserialized, {})
504+
return deserialized
505+
506+
507+
if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
508+
elif polling is False: polling_method = AsyncNoPolling()
509+
else: polling_method = polling
510+
if cont_token:
511+
return AsyncLROPoller.from_continuation_token(
512+
polling_method=polling_method,
513+
continuation_token=cont_token,
514+
client=self._client,
515+
deserialization_callback=get_long_running_output
516+
)
517+
else:
518+
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
519+
520+
begin_create_identity.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/createArcIdentity'} # type: ignore

0 commit comments

Comments
 (0)