Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ReleasePR track2_azure-mgmt-azurestackhci] merge 2023-08-01-preview API version to main repo #23946

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdk/azurestackhci/azure-mgmt-azurestackhci/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"@autorest/[email protected]",
"@autorest/[email protected]"
],
"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/[email protected] --use=@autorest/[email protected] --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/[email protected] --use=@autorest/[email protected] --version=3.7.2",
"readme": "specification/azurestackhci/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]]

Expand All @@ -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.
Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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
Loading