From 547c8cc7568cc4e9a7fbdb20ef71ce3d4fd6dafe Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 6 Dec 2022 04:09:57 +0000 Subject: [PATCH] CodeGen from PR 21717 in Azure/azure-rest-api-specs [Hub Generated] Publish private branch 'user/pri/2022-12-01' (#21717) * add or modify files * Fixed spellcheck validation err * Fixed avocado validation err * Fixed avocado validation err * Fixed avocado validation err * Fixed avocado validation err * Fixed avocado validation err * Fixed avocado validation err * Fixed avocado validation err * Fixed avocado validation err * avacado fix * avacado fix * avacado fix * avacado fix' * avacado fix * avacado fix * revert custom-words.txt * update custom-words.txt * updated PreCheckResult * removed SystemData * removed SystemData Co-authored-by: Aditya Ravishankar --- .../azure-mgmt-azurestackhci/_meta.json | 4 +- .../azurestackhci/_azure_stack_hci_client.py | 8 +- .../mgmt/azurestackhci/_configuration.py | 4 +- .../azure/mgmt/azurestackhci/_version.py | 2 +- .../aio/_azure_stack_hci_client.py | 8 +- .../mgmt/azurestackhci/aio/_configuration.py | 4 +- .../azurestackhci/aio/operations/__init__.py | 4 +- .../operations/_arc_settings_operations.py | 18 +- .../aio/operations/_clusters_operations.py | 26 +- .../aio/operations/_extensions_operations.py | 16 +- .../aio/operations/_offers_operations.py | 6 +- .../aio/operations/_operations.py | 2 +- .../aio/operations/_publishers_operations.py | 4 +- .../aio/operations/_skus_operations.py | 4 +- .../aio/operations/_update_runs_operations.py | 315 +++++++++++++- .../_update_summaries_operations.py | 283 ++++++++++++- .../aio/operations/_updates_operations.py | 313 +++++++++++++- .../mgmt/azurestackhci/models/__init__.py | 10 + .../models/_azure_stack_hci_client_enums.py | 63 +++ .../mgmt/azurestackhci/models/_models_py3.py | 300 ++++++++++++- .../mgmt/azurestackhci/operations/__init__.py | 4 +- .../operations/_arc_settings_operations.py | 32 +- .../operations/_clusters_operations.py | 44 +- .../operations/_extensions_operations.py | 26 +- .../operations/_offers_operations.py | 12 +- .../azurestackhci/operations/_operations.py | 4 +- .../operations/_publishers_operations.py | 8 +- .../operations/_skus_operations.py | 8 +- .../operations/_update_runs_operations.py | 394 +++++++++++++++++- .../_update_summaries_operations.py | 346 ++++++++++++++- .../operations/_updates_operations.py | 380 ++++++++++++++++- .../generated_samples/create_arc_identity.py | 2 +- .../generated_samples/create_cluster.py | 2 +- .../create_cluster_identity.py | 2 +- .../generated_samples/delete_arc_setting.py | 2 +- .../generated_samples/delete_cluster.py | 2 +- .../generated_samples/delete_extension.py | 2 +- .../generated_samples/delete_update_runs.py | 43 ++ .../delete_update_summaries.py | 41 ++ .../generated_samples/delete_updates.py | 42 ++ .../extend_software_assurance_benefit.py | 2 +- .../generated_samples/generate_password.py | 2 +- .../generated_samples/get_arc_setting.py | 2 +- .../generated_samples/get_cluster.py | 2 +- .../generated_samples/get_extension.py | 2 +- .../generated_samples/get_offer.py | 2 +- .../generated_samples/get_publisher.py | 2 +- .../generated_samples/get_sku.py | 2 +- .../generated_samples/get_update_runs.py | 2 +- .../generated_samples/get_update_summaries.py | 2 +- .../generated_samples/get_updates.py | 2 +- .../list_arc_settings_by_cluster.py | 2 +- .../list_clusters_by_resource_group.py | 2 +- .../list_clusters_by_subscription.py | 2 +- .../list_extensions_by_arc_setting.py | 2 +- .../list_offers_by_cluster.py | 2 +- .../list_offers_by_publisher.py | 2 +- .../generated_samples/list_operations.py | 2 +- .../list_publishers_by_cluster.py | 2 +- .../generated_samples/list_skus_by_offer.py | 2 +- .../generated_samples/list_update_runs.py | 2 +- .../list_update_summaries.py | 2 +- .../generated_samples/list_updates.py | 2 +- .../generated_samples/patch_arc_setting.py | 2 +- .../generated_samples/patch_extension.py | 2 +- .../generated_samples/post_updates.py | 2 +- .../generated_samples/put_extension.py | 2 +- .../generated_samples/put_update_runs.py | 68 +++ .../generated_samples/put_update_summaries.py | 51 +++ .../generated_samples/put_updates.py | 69 +++ .../generated_samples/update_cluster.py | 2 +- .../generated_samples/upload_certificate.py | 2 +- 72 files changed, 2826 insertions(+), 210 deletions(-) create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_runs.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_summaries.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_updates.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_runs.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_summaries.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_updates.py diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/_meta.json b/sdk/azurestackhci/azure-mgmt-azurestackhci/_meta.json index 5bb7a75149c6..d82b25c791e0 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/_meta.json +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/_meta.json @@ -1,11 +1,11 @@ { - "commit": "1fefe3f5cee88319b17c08a2dbf95e1e983a9f8c", + "commit": "ad793510b0ec98c8eb45bca6608639c527a94389", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ "@autorest/python@6.2.7", "@autorest/modelerfour@4.24.3" ], - "autorest_command": "autorest specification/azurestackhci/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.7 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "autorest_command": "autorest specification/azurestackhci/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.2.7 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "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 81f1228087f7..8de7ff15fa4d 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 @@ -42,10 +42,10 @@ class AzureStackHCIClient: # pylint: disable=client-accepts-api-version-keyword :vartype clusters: azure.mgmt.azurestackhci.operations.ClustersOperations :ivar extensions: ExtensionsOperations operations :vartype extensions: azure.mgmt.azurestackhci.operations.ExtensionsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.azurestackhci.operations.Operations :ivar offers: OffersOperations operations :vartype offers: azure.mgmt.azurestackhci.operations.OffersOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.azurestackhci.operations.Operations :ivar publishers: PublishersOperations operations :vartype publishers: azure.mgmt.azurestackhci.operations.PublishersOperations :ivar skus: SkusOperations operations @@ -62,7 +62,7 @@ class AzureStackHCIClient: # pylint: disable=client-accepts-api-version-keyword :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2022-10-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2022-12-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -88,8 +88,8 @@ def __init__( self.arc_settings = ArcSettingsOperations(self._client, self._config, self._serialize, self._deserialize) self.clusters = ClustersOperations(self._client, self._config, self._serialize, self._deserialize) self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.offers = OffersOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.publishers = PublishersOperations(self._client, self._config, self._serialize, self._deserialize) self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize) self.update_runs = UpdateRunsOperations(self._client, self._config, self._serialize, self._deserialize) 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 8377a65c1316..c8cd2334310a 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_configuration.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_configuration.py @@ -35,14 +35,14 @@ class AzureStackHCIClientConfiguration(Configuration): # pylint: disable=too-ma :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-10-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2022-12-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(AzureStackHCIClientConfiguration, self).__init__(**kwargs) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", "2022-10-01") + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", "2022-12-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") 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 0d5779dc14de..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 = "8.0.0b1" +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 4a56a4ae0900..e96439004ccb 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 @@ -42,10 +42,10 @@ class AzureStackHCIClient: # pylint: disable=client-accepts-api-version-keyword :vartype clusters: azure.mgmt.azurestackhci.aio.operations.ClustersOperations :ivar extensions: ExtensionsOperations operations :vartype extensions: azure.mgmt.azurestackhci.aio.operations.ExtensionsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.azurestackhci.aio.operations.Operations :ivar offers: OffersOperations operations :vartype offers: azure.mgmt.azurestackhci.aio.operations.OffersOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.azurestackhci.aio.operations.Operations :ivar publishers: PublishersOperations operations :vartype publishers: azure.mgmt.azurestackhci.aio.operations.PublishersOperations :ivar skus: SkusOperations operations @@ -62,7 +62,7 @@ class AzureStackHCIClient: # pylint: disable=client-accepts-api-version-keyword :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2022-10-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2022-12-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -88,8 +88,8 @@ def __init__( self.arc_settings = ArcSettingsOperations(self._client, self._config, self._serialize, self._deserialize) self.clusters = ClustersOperations(self._client, self._config, self._serialize, self._deserialize) self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.offers = OffersOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.publishers = PublishersOperations(self._client, self._config, self._serialize, self._deserialize) self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize) self.update_runs = UpdateRunsOperations(self._client, self._config, self._serialize, self._deserialize) 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 77e404345d18..0c9fdc1920a1 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 @@ -35,14 +35,14 @@ class AzureStackHCIClientConfiguration(Configuration): # pylint: disable=too-ma :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-10-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2022-12-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(AzureStackHCIClientConfiguration, self).__init__(**kwargs) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", "2022-10-01") + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", "2022-12-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/__init__.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/__init__.py index cf0e7fd20bfd..4f2531a63b22 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/__init__.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/__init__.py @@ -9,8 +9,8 @@ from ._arc_settings_operations import ArcSettingsOperations from ._clusters_operations import ClustersOperations from ._extensions_operations import ExtensionsOperations -from ._operations import Operations from ._offers_operations import OffersOperations +from ._operations import Operations from ._publishers_operations import PublishersOperations from ._skus_operations import SkusOperations from ._update_runs_operations import UpdateRunsOperations @@ -25,8 +25,8 @@ "ArcSettingsOperations", "ClustersOperations", "ExtensionsOperations", - "Operations", "OffersOperations", + "Operations", "PublishersOperations", "SkusOperations", "UpdateRunsOperations", 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 d231da05e877..4810d74ed3b2 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 @@ -87,7 +87,7 @@ def list_by_cluster( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.ArcSettingList] = kwargs.pop("cls", None) @@ -191,7 +191,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) @@ -338,7 +338,7 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -495,7 +495,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -561,7 +561,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -626,7 +626,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -702,7 +702,7 @@ async def generate_password( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.PasswordCredential] = kwargs.pop("cls", None) @@ -756,7 +756,7 @@ async def _create_identity_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[Optional[_models.ArcIdentityResponse]] = kwargs.pop("cls", None) @@ -829,7 +829,7 @@ async def begin_create_identity( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.ArcIdentityResponse] = kwargs.pop("cls", None) 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 8dafad0496df..7d76f79cdeb7 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 @@ -82,7 +82,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Cluster" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.ClusterList] = kwargs.pop("cls", None) @@ -169,7 +169,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.ClusterList] = kwargs.pop("cls", None) @@ -267,7 +267,7 @@ async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) @@ -394,7 +394,7 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -533,7 +533,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -598,7 +598,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -657,7 +657,7 @@ async def begin_delete(self, resource_group_name: str, cluster_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -717,7 +717,7 @@ async def _upload_certificate_initial( # pylint: disable=inconsistent-return-st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -871,7 +871,7 @@ async def begin_upload_certificate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -933,7 +933,7 @@ async def _create_identity_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[Optional[_models.ClusterIdentityResponse]] = kwargs.pop("cls", None) @@ -1002,7 +1002,7 @@ async def begin_create_identity( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.ClusterIdentityResponse] = kwargs.pop("cls", None) @@ -1067,7 +1067,7 @@ async def _extend_software_assurance_benefit_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -1231,7 +1231,7 @@ async def begin_extend_software_assurance_benefit( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) 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 ee73f7b4d830..ee779b5b408b 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 @@ -88,7 +88,7 @@ def list_by_arc_setting( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.ExtensionList] = kwargs.pop("cls", None) @@ -195,7 +195,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.Extension] = kwargs.pop("cls", None) @@ -256,7 +256,7 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -443,7 +443,7 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -515,7 +515,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -700,7 +700,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -766,7 +766,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -834,7 +834,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_offers_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_offers_operations.py index 30a7d0920e11..7a36151769a6 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_offers_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_offers_operations.py @@ -91,7 +91,7 @@ def list_by_publisher( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OfferList] = kwargs.pop("cls", None) @@ -189,7 +189,7 @@ def list_by_cluster( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OfferList] = kwargs.pop("cls", None) @@ -304,7 +304,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.Offer] = kwargs.pop("cls", None) 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 9163a347a0b0..eaf03e1bab22 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 @@ -75,7 +75,7 @@ async def list(self, **kwargs: Any) -> _models.OperationListResult: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_publishers_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_publishers_operations.py index da09a83310b9..ec36fa17afe4 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_publishers_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_publishers_operations.py @@ -77,7 +77,7 @@ def list_by_cluster( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.PublisherList] = kwargs.pop("cls", None) @@ -180,7 +180,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.Publisher] = kwargs.pop("cls", None) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_skus_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_skus_operations.py index 9c4cd3234003..f88081cb3417 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_skus_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_skus_operations.py @@ -90,7 +90,7 @@ def list_by_offer( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.SkuList] = kwargs.pop("cls", None) @@ -210,7 +210,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.Sku] = kwargs.pop("cls", None) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_update_runs_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_update_runs_operations.py index 94e3ede063e8..abb525d54d59 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_update_runs_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_update_runs_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -21,15 +21,22 @@ ) 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.core.utils import case_insensitive_dict 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._update_runs_operations import build_get_request, build_list_request +from ...operations._update_runs_operations import ( + build_delete_request, + build_get_request, + build_list_request, + build_put_request, +) if sys.version_info >= (3, 8): from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports @@ -79,7 +86,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.UpdateRunList] = kwargs.pop("cls", None) @@ -154,11 +161,309 @@ async def get_next(next_link=None): "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns" } + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + update_run_name=update_run_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}" + } + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete specified Update Run. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + update_run_name=update_run_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}" + } + + @overload + async def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_run_name: str, + update_runs_properties: _models.UpdateRun, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.UpdateRun: + """Put Update runs for a specified update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :param update_runs_properties: Properties of the updateRuns object. Required. + :type update_runs_properties: ~azure.mgmt.azurestackhci.models.UpdateRun + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpdateRun or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_run_name: str, + update_runs_properties: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.UpdateRun: + """Put Update runs for a specified update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :param update_runs_properties: Properties of the updateRuns object. Required. + :type update_runs_properties: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpdateRun or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_run_name: str, + update_runs_properties: Union[_models.UpdateRun, IO], + **kwargs: Any + ) -> _models.UpdateRun: + """Put Update runs for a specified update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :param update_runs_properties: Properties of the updateRuns object. Is either a model type or a + IO type. Required. + :type update_runs_properties: ~azure.mgmt.azurestackhci.models.UpdateRun or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpdateRun or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateRun] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(update_runs_properties, (IO, bytes)): + _content = update_runs_properties + else: + _json = self._serialize.body(update_runs_properties, "UpdateRun") + + request = build_put_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + update_run_name=update_run_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.put.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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("UpdateRun", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + put.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}" + } + @distributed_trace_async async def get( self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any ) -> _models.UpdateRun: - """List all Update runs for a specified update. + """Get the Update run for a specified update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -185,7 +490,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.UpdateRun] = kwargs.pop("cls", None) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_update_summaries_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_update_summaries_operations.py index 55d6442aa8e6..8e05cdc291c2 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_update_summaries_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_update_summaries_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -21,15 +21,22 @@ ) 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.core.utils import case_insensitive_dict 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._update_summaries_operations import build_get_request, build_list_request +from ...operations._update_summaries_operations import ( + build_delete_request, + build_get_request, + build_list_request, + build_put_request, +) if sys.version_info >= (3, 8): from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports @@ -78,7 +85,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.UpdateSummariesList] = kwargs.pop("cls", None) @@ -152,6 +159,274 @@ async def get_next(next_link=None): "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries" } + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default" + } + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Delete Update Summaries. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_name=cluster_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default" + } + + @overload + async def put( + self, + resource_group_name: str, + cluster_name: str, + update_location_properties: _models.UpdateSummaries, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.UpdateSummaries: + """Put Update summaries under the HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_location_properties: Properties of the UpdateSummaries resource. Required. + :type update_location_properties: ~azure.mgmt.azurestackhci.models.UpdateSummaries + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpdateSummaries or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def put( + self, + resource_group_name: str, + cluster_name: str, + update_location_properties: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.UpdateSummaries: + """Put Update summaries under the HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_location_properties: Properties of the UpdateSummaries resource. Required. + :type update_location_properties: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpdateSummaries or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def put( + self, + resource_group_name: str, + cluster_name: str, + update_location_properties: Union[_models.UpdateSummaries, IO], + **kwargs: Any + ) -> _models.UpdateSummaries: + """Put Update summaries under the HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_location_properties: Properties of the UpdateSummaries resource. Is either a + model type or a IO type. Required. + :type update_location_properties: ~azure.mgmt.azurestackhci.models.UpdateSummaries or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpdateSummaries or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateSummaries] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(update_location_properties, (IO, bytes)): + _content = update_location_properties + else: + _json = self._serialize.body(update_location_properties, "UpdateSummaries") + + request = build_put_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.put.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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("UpdateSummaries", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + put.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default" + } + @distributed_trace_async async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.UpdateSummaries: """Get all Update summaries under the HCI cluster. @@ -177,7 +452,7 @@ async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.UpdateSummaries] = kwargs.pop("cls", None) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_updates_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_updates_operations.py index 688fc3945bf9..88229543cb1a 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_updates_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_updates_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -31,7 +31,13 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._updates_operations import build_get_request, build_list_request, build_post_request +from ...operations._updates_operations import ( + build_delete_request, + build_get_request, + build_list_request, + build_post_request, + build_put_request, +) if sys.version_info >= (3, 8): from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports @@ -74,7 +80,7 @@ async def _post_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -103,8 +109,14 @@ async def _post_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _post_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/apply" @@ -138,7 +150,7 @@ async def begin_post( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -164,7 +176,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- if polling is True: polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) @@ -200,7 +213,7 @@ def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> As _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.UpdateList] = kwargs.pop("cls", None) @@ -274,6 +287,290 @@ async def get_next(next_link=None): "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates" } + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}" + } + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete specified Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}" + } + + @overload + async def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_properties: _models.Update, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Update: + """Put specified Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_properties: Properties of the Updates object. Required. + :type update_properties: ~azure.mgmt.azurestackhci.models.Update + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Update or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.Update + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_properties: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Update: + """Put specified Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_properties: Properties of the Updates object. Required. + :type update_properties: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Update or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.Update + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_properties: Union[_models.Update, IO], + **kwargs: Any + ) -> _models.Update: + """Put specified Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_properties: Properties of the Updates object. Is either a model type or a IO + type. Required. + :type update_properties: ~azure.mgmt.azurestackhci.models.Update or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Update or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.Update + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Update] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(update_properties, (IO, bytes)): + _content = update_properties + else: + _json = self._serialize.body(update_properties, "Update") + + request = build_put_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.put.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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("Update", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + put.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}" + } + @distributed_trace_async async def get(self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any) -> _models.Update: """Get specified Update. @@ -301,7 +598,7 @@ async def get(self, resource_group_name: str, cluster_name: str, update_name: st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.Update] = kwargs.pop("cls", None) 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 5a44c73c8924..c99d3b29b6a7 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 @@ -32,6 +32,8 @@ from ._models_py3 import PasswordCredential from ._models_py3 import PerNodeExtensionState from ._models_py3 import PerNodeState +from ._models_py3 import PrecheckResult +from ._models_py3 import PrecheckResultTags from ._models_py3 import ProxyResource from ._models_py3 import Publisher from ._models_py3 import PublisherList @@ -63,12 +65,15 @@ from ._azure_stack_hci_client_enums import CreatedByType from ._azure_stack_hci_client_enums import DiagnosticLevel from ._azure_stack_hci_client_enums import ExtensionAggregateState +from ._azure_stack_hci_client_enums import HealthState from ._azure_stack_hci_client_enums import ImdsAttestation from ._azure_stack_hci_client_enums import ManagedServiceIdentityType from ._azure_stack_hci_client_enums import NodeArcState from ._azure_stack_hci_client_enums import NodeExtensionState from ._azure_stack_hci_client_enums import Origin from ._azure_stack_hci_client_enums import ProvisioningState +from ._azure_stack_hci_client_enums import RebootRequirement +from ._azure_stack_hci_client_enums import Severity from ._azure_stack_hci_client_enums import SoftwareAssuranceIntent from ._azure_stack_hci_client_enums import SoftwareAssuranceStatus from ._azure_stack_hci_client_enums import State @@ -107,6 +112,8 @@ "PasswordCredential", "PerNodeExtensionState", "PerNodeState", + "PrecheckResult", + "PrecheckResultTags", "ProxyResource", "Publisher", "PublisherList", @@ -137,12 +144,15 @@ "CreatedByType", "DiagnosticLevel", "ExtensionAggregateState", + "HealthState", "ImdsAttestation", "ManagedServiceIdentityType", "NodeArcState", "NodeExtensionState", "Origin", "ProvisioningState", + "RebootRequirement", + "Severity", "SoftwareAssuranceIntent", "SoftwareAssuranceStatus", "State", diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_azure_stack_hci_client_enums.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_azure_stack_hci_client_enums.py index 7b1d6193c149..dd3b23867a12 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_azure_stack_hci_client_enums.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_azure_stack_hci_client_enums.py @@ -34,6 +34,9 @@ class ArcSettingAggregateState(str, Enum, metaclass=CaseInsensitiveEnumMeta): PARTIALLY_SUCCEEDED = "PartiallySucceeded" PARTIALLY_CONNECTED = "PartiallyConnected" IN_PROGRESS = "InProgress" + ACCEPTED = "Accepted" + PROVISIONING = "Provisioning" + DISABLE_IN_PROGRESS = "DisableInProgress" class AvailabilityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -86,6 +89,19 @@ class ExtensionAggregateState(str, Enum, metaclass=CaseInsensitiveEnumMeta): PARTIALLY_SUCCEEDED = "PartiallySucceeded" PARTIALLY_CONNECTED = "PartiallyConnected" IN_PROGRESS = "InProgress" + ACCEPTED = "Accepted" + PROVISIONING = "Provisioning" + + +class HealthState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """HealthState.""" + + UNKNOWN = "Unknown" + SUCCESS = "Success" + FAILURE = "Failure" + WARNING = "Warning" + ERROR = "Error" + IN_PROGRESS = "InProgress" class ImdsAttestation(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -121,6 +137,12 @@ class NodeArcState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATING = "Updating" DELETING = "Deleting" MOVING = "Moving" + PARTIALLY_SUCCEEDED = "PartiallySucceeded" + PARTIALLY_CONNECTED = "PartiallyConnected" + IN_PROGRESS = "InProgress" + ACCEPTED = "Accepted" + PROVISIONING = "Provisioning" + DISABLE_IN_PROGRESS = "DisableInProgress" class NodeExtensionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -138,6 +160,11 @@ class NodeExtensionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATING = "Updating" DELETING = "Deleting" MOVING = "Moving" + PARTIALLY_SUCCEEDED = "PartiallySucceeded" + PARTIALLY_CONNECTED = "PartiallyConnected" + IN_PROGRESS = "InProgress" + ACCEPTED = "Accepted" + PROVISIONING = "Provisioning" class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -153,11 +180,43 @@ class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Provisioning state of the ArcSetting proxy resource.""" + NOT_SPECIFIED = "NotSpecified" + ERROR = "Error" SUCCEEDED = "Succeeded" FAILED = "Failed" CANCELED = "Canceled" + CONNECTED = "Connected" + DISCONNECTED = "Disconnected" + DELETED = "Deleted" + CREATING = "Creating" + UPDATING = "Updating" + DELETING = "Deleting" + MOVING = "Moving" + PARTIALLY_SUCCEEDED = "PartiallySucceeded" + PARTIALLY_CONNECTED = "PartiallyConnected" + IN_PROGRESS = "InProgress" ACCEPTED = "Accepted" PROVISIONING = "Provisioning" + DISABLE_IN_PROGRESS = "DisableInProgress" + + +class RebootRequirement(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """RebootRequirement.""" + + UNKNOWN = "Unknown" + TRUE = "True" + FALSE = "False" + + +class Severity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Severity of the result (Critical, Warning, Informational, Hidden). This answers how important + the result is. Critical is the only update-blocking severity. + """ + + CRITICAL = "Critical" + WARNING = "Warning" + INFORMATIONAL = "Informational" + HIDDEN = "Hidden" class SoftwareAssuranceIntent(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -205,6 +264,10 @@ class Status(str, Enum, metaclass=CaseInsensitiveEnumMeta): NOT_CONNECTED_RECENTLY = "NotConnectedRecently" DISCONNECTED = "Disconnected" ERROR = "Error" + NOT_SPECIFIED = "NotSpecified" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + IN_PROGRESS = "InProgress" class UpdateRunPropertiesState(str, Enum, metaclass=CaseInsensitiveEnumMeta): 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 e6b299d74c23..90b47afd7c15 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 @@ -185,7 +185,9 @@ class ArcSetting(ProxyResource): # pylint: disable=too-many-instance-attributes information. :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData :ivar provisioning_state: Provisioning state of the ArcSetting proxy resource. Known values - are: "Succeeded", "Failed", "Canceled", "Accepted", and "Provisioning". + are: "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", + "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", + "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". :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. @@ -201,7 +203,7 @@ class ArcSetting(ProxyResource): # pylint: disable=too-many-instance-attributes :ivar aggregate_state: Aggregate state of Arc agent across the nodes in this HCI cluster. Known values are: "NotSpecified", "Error", "Succeeded", "Canceled", "Failed", "Connected", "Disconnected", "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", - "PartiallyConnected", and "InProgress". + "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". :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.mgmt.azurestackhci.models.PerNodeState] @@ -406,11 +408,14 @@ class Cluster(TrackedResource): # pylint: disable=too-many-instance-attributes :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. :vartype location: str - :ivar provisioning_state: Provisioning state. Known values are: "Succeeded", "Failed", - "Canceled", "Accepted", and "Provisioning". + :ivar provisioning_state: Provisioning state. Known values are: "NotSpecified", "Error", + "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", "Deleted", "Creating", + "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", + "Accepted", "Provisioning", and "DisableInProgress". :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState :ivar status: Status of the cluster agent. Known values are: "NotYetRegistered", - "ConnectedRecently", "NotConnectedRecently", "Disconnected", and "Error". + "ConnectedRecently", "NotConnectedRecently", "Disconnected", "Error", "NotSpecified", + "Succeeded", "Failed", and "InProgress". :vartype status: str or ~azure.mgmt.azurestackhci.models.Status :ivar cloud_id: Unique, immutable resource id. :vartype cloud_id: str @@ -443,6 +448,8 @@ class Cluster(TrackedResource): # pylint: disable=too-many-instance-attributes :vartype last_billing_timestamp: ~datetime.datetime :ivar service_endpoint: Region specific DataPath Endpoint of the cluster. :vartype service_endpoint: str + :ivar resource_provider_object_id: Object id of RP Service Principal. + :vartype resource_provider_object_id: str :ivar principal_id: The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. :vartype principal_id: str @@ -477,6 +484,7 @@ class Cluster(TrackedResource): # pylint: disable=too-many-instance-attributes "last_sync_timestamp": {"readonly": True}, "last_billing_timestamp": {"readonly": True}, "service_endpoint": {"readonly": True}, + "resource_provider_object_id": {"readonly": True}, "principal_id": {"readonly": True}, "tenant_id": {"readonly": True}, } @@ -508,6 +516,7 @@ class Cluster(TrackedResource): # pylint: disable=too-many-instance-attributes "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"}, + "resource_provider_object_id": {"key": "properties.resourceProviderObjectId", "type": "str"}, "principal_id": {"key": "identity.principalId", "type": "str"}, "tenant_id": {"key": "identity.tenantId", "type": "str"}, "type_identity_type": {"key": "identity.type", "type": "str"}, @@ -580,6 +589,7 @@ def __init__( # pylint: disable=too-many-locals self.last_sync_timestamp = None self.last_billing_timestamp = None self.service_endpoint = None + self.resource_provider_object_id = None self.principal_id = None self.tenant_id = None self.type_identity_type = type_identity_type @@ -716,6 +726,8 @@ class ClusterNode(_serialization.Model): # pylint: disable=too-many-instance-at :ivar node_type: Type of the cluster node hardware. Known values are: "FirstParty" and "ThirdParty". :vartype node_type: str or ~azure.mgmt.azurestackhci.models.ClusterNodeType + :ivar ehc_resource_id: Edge Hardware Center Resource Id. + :vartype ehc_resource_id: str :ivar manufacturer: Manufacturer of the cluster node hardware. :vartype manufacturer: str :ivar model: Model name of the cluster node hardware. @@ -739,6 +751,7 @@ class ClusterNode(_serialization.Model): # pylint: disable=too-many-instance-at "id": {"readonly": True}, "windows_server_subscription": {"readonly": True}, "node_type": {"readonly": True}, + "ehc_resource_id": {"readonly": True}, "manufacturer": {"readonly": True}, "model": {"readonly": True}, "os_name": {"readonly": True}, @@ -754,6 +767,7 @@ class ClusterNode(_serialization.Model): # pylint: disable=too-many-instance-at "id": {"key": "id", "type": "float"}, "windows_server_subscription": {"key": "windowsServerSubscription", "type": "str"}, "node_type": {"key": "nodeType", "type": "str"}, + "ehc_resource_id": {"key": "EhcResourceId", "type": "str"}, "manufacturer": {"key": "manufacturer", "type": "str"}, "model": {"key": "model", "type": "str"}, "os_name": {"key": "osName", "type": "str"}, @@ -771,6 +785,7 @@ def __init__(self, **kwargs): self.id = None self.windows_server_subscription = None self.node_type = None + self.ehc_resource_id = None self.manufacturer = None self.model = None self.os_name = None @@ -898,6 +913,8 @@ class ClusterReportedProperties(_serialization.Model): :ivar diagnostic_level: Level of diagnostic data emitted by the cluster. Known values are: "Off", "Basic", and "Enhanced". :vartype diagnostic_level: str or ~azure.mgmt.azurestackhci.models.DiagnosticLevel + :ivar supported_capabilities: Capabilities supported by the cluster. + :vartype supported_capabilities: list[str] """ _validation = { @@ -907,6 +924,7 @@ class ClusterReportedProperties(_serialization.Model): "nodes": {"readonly": True}, "last_updated": {"readonly": True}, "imds_attestation": {"readonly": True}, + "supported_capabilities": {"readonly": True}, } _attribute_map = { @@ -917,6 +935,7 @@ class ClusterReportedProperties(_serialization.Model): "last_updated": {"key": "lastUpdated", "type": "iso-8601"}, "imds_attestation": {"key": "imdsAttestation", "type": "str"}, "diagnostic_level": {"key": "diagnosticLevel", "type": "str"}, + "supported_capabilities": {"key": "supportedCapabilities", "type": "[str]"}, } def __init__(self, *, diagnostic_level: Optional[Union[str, "_models.DiagnosticLevel"]] = None, **kwargs): @@ -933,6 +952,7 @@ def __init__(self, *, diagnostic_level: Optional[Union[str, "_models.DiagnosticL self.last_updated = None self.imds_attestation = None self.diagnostic_level = diagnostic_level + self.supported_capabilities = None class ErrorAdditionalInfo(_serialization.Model): @@ -1043,12 +1063,14 @@ class Extension(ProxyResource): # pylint: disable=too-many-instance-attributes information. :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData :ivar provisioning_state: Provisioning state of the Extension proxy resource. Known values are: - "Succeeded", "Failed", "Canceled", "Accepted", and "Provisioning". + "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", + "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", + "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". :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. Known values are: "NotSpecified", "Error", "Succeeded", "Canceled", "Failed", "Connected", "Disconnected", "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", - "PartiallyConnected", and "InProgress". + "PartiallyConnected", "InProgress", "Accepted", and "Provisioning". :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: @@ -1071,6 +1093,9 @@ class Extension(ProxyResource): # pylint: disable=too-many-instance-attributes :vartype settings: JSON :ivar protected_settings: Protected settings (may contain secrets). :vartype protected_settings: JSON + :ivar enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version available. + :vartype enable_automatic_upgrade: bool """ _validation = { @@ -1098,6 +1123,7 @@ class Extension(ProxyResource): # pylint: disable=too-many-instance-attributes "auto_upgrade_minor_version": {"key": "properties.extensionParameters.autoUpgradeMinorVersion", "type": "bool"}, "settings": {"key": "properties.extensionParameters.settings", "type": "object"}, "protected_settings": {"key": "properties.extensionParameters.protectedSettings", "type": "object"}, + "enable_automatic_upgrade": {"key": "properties.extensionParameters.enableAutomaticUpgrade", "type": "bool"}, } def __init__( @@ -1110,6 +1136,7 @@ def __init__( auto_upgrade_minor_version: Optional[bool] = None, settings: Optional[JSON] = None, protected_settings: Optional[JSON] = None, + enable_automatic_upgrade: Optional[bool] = None, **kwargs ): """ @@ -1131,6 +1158,9 @@ def __init__( :paramtype settings: JSON :keyword protected_settings: Protected settings (may contain secrets). :paramtype protected_settings: JSON + :keyword enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version available. + :paramtype enable_automatic_upgrade: bool """ super().__init__(**kwargs) self.provisioning_state = None @@ -1143,6 +1173,7 @@ def __init__( self.auto_upgrade_minor_version = auto_upgrade_minor_version self.settings = settings self.protected_settings = protected_settings + self.enable_automatic_upgrade = enable_automatic_upgrade class ExtensionList(_serialization.Model): @@ -1494,7 +1525,8 @@ class PerNodeExtensionState(_serialization.Model): :vartype extension: str :ivar state: State of Arc Extension in this node. Known values are: "NotSpecified", "Error", "Succeeded", "Canceled", "Failed", "Connected", "Disconnected", "Deleted", "Creating", - "Updating", "Deleting", and "Moving". + "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", + "Accepted", and "Provisioning". :vartype state: str or ~azure.mgmt.azurestackhci.models.NodeExtensionState """ @@ -1529,7 +1561,8 @@ class PerNodeState(_serialization.Model): :vartype arc_instance: str :ivar state: State of Arc agent in this node. Known values are: "NotSpecified", "Error", "Succeeded", "Canceled", "Failed", "Connected", "Disconnected", "Deleted", "Creating", - "Updating", "Deleting", and "Moving". + "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", + "Accepted", "Provisioning", and "DisableInProgress". :vartype state: str or ~azure.mgmt.azurestackhci.models.NodeArcState """ @@ -1553,6 +1586,151 @@ def __init__(self, **kwargs): self.state = None +class PrecheckResult(_serialization.Model): # pylint: disable=too-many-instance-attributes + """PrecheckResult. + + :ivar name: Name of the individual test/rule/alert that was executed. Unique, not exposed to + the customer. + :vartype name: str + :ivar tags: Key-value pairs that allow grouping/filtering individual tests. + :vartype tags: ~azure.mgmt.azurestackhci.models.PrecheckResultTags + :ivar title: User-facing name; one or more sentences indicating the direct issue. + :vartype title: str + :ivar status: The status of the check running (i.e. Failed, Succeeded, In Progress). This + answers whether the check ran, and passed or failed. Known values are: "NotYetRegistered", + "ConnectedRecently", "NotConnectedRecently", "Disconnected", "Error", "NotSpecified", + "Succeeded", "Failed", and "InProgress". + :vartype status: str or ~azure.mgmt.azurestackhci.models.Status + :ivar severity: Severity of the result (Critical, Warning, Informational, Hidden). This answers + how important the result is. Critical is the only update-blocking severity. Known values are: + "Critical", "Warning", "Informational", and "Hidden". + :vartype severity: str or ~azure.mgmt.azurestackhci.models.Severity + :ivar description: Detailed overview of the issue and what impact the issue has on the stamp. + :vartype description: str + :ivar remediation: Set of steps that can be taken to resolve the issue found. + :vartype remediation: str + :ivar target_resource_id: The unique identifier for the affected resource (such as a node or + drive). + :vartype target_resource_id: str + :ivar target_resource_name: The name of the affected resource. + :vartype target_resource_name: str + :ivar timestamp: The Time in which the HealthCheck was called. + :vartype timestamp: ~datetime.datetime + :ivar additional_data: Property bag of key value pairs for additional information. + :vartype additional_data: str + :ivar health_check_source: The name of the services called for the HealthCheck (I.E. + Test-AzureStack, Test-Cluster). + :vartype health_check_source: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "tags": {"key": "tags", "type": "PrecheckResultTags"}, + "title": {"key": "title", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "severity": {"key": "severity", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "remediation": {"key": "remediation", "type": "str"}, + "target_resource_id": {"key": "targetResourceID", "type": "str"}, + "target_resource_name": {"key": "targetResourceName", "type": "str"}, + "timestamp": {"key": "timestamp", "type": "iso-8601"}, + "additional_data": {"key": "additionalData", "type": "str"}, + "health_check_source": {"key": "healthCheckSource", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + tags: Optional["_models.PrecheckResultTags"] = None, + title: Optional[str] = None, + status: Optional[Union[str, "_models.Status"]] = None, + severity: Optional[Union[str, "_models.Severity"]] = None, + description: Optional[str] = None, + remediation: Optional[str] = None, + target_resource_id: Optional[str] = None, + target_resource_name: Optional[str] = None, + timestamp: Optional[datetime.datetime] = None, + additional_data: Optional[str] = None, + health_check_source: Optional[str] = None, + **kwargs + ): + """ + :keyword name: Name of the individual test/rule/alert that was executed. Unique, not exposed to + the customer. + :paramtype name: str + :keyword tags: Key-value pairs that allow grouping/filtering individual tests. + :paramtype tags: ~azure.mgmt.azurestackhci.models.PrecheckResultTags + :keyword title: User-facing name; one or more sentences indicating the direct issue. + :paramtype title: str + :keyword status: The status of the check running (i.e. Failed, Succeeded, In Progress). This + answers whether the check ran, and passed or failed. Known values are: "NotYetRegistered", + "ConnectedRecently", "NotConnectedRecently", "Disconnected", "Error", "NotSpecified", + "Succeeded", "Failed", and "InProgress". + :paramtype status: str or ~azure.mgmt.azurestackhci.models.Status + :keyword severity: Severity of the result (Critical, Warning, Informational, Hidden). This + answers how important the result is. Critical is the only update-blocking severity. Known + values are: "Critical", "Warning", "Informational", and "Hidden". + :paramtype severity: str or ~azure.mgmt.azurestackhci.models.Severity + :keyword description: Detailed overview of the issue and what impact the issue has on the + stamp. + :paramtype description: str + :keyword remediation: Set of steps that can be taken to resolve the issue found. + :paramtype remediation: str + :keyword target_resource_id: The unique identifier for the affected resource (such as a node or + drive). + :paramtype target_resource_id: str + :keyword target_resource_name: The name of the affected resource. + :paramtype target_resource_name: str + :keyword timestamp: The Time in which the HealthCheck was called. + :paramtype timestamp: ~datetime.datetime + :keyword additional_data: Property bag of key value pairs for additional information. + :paramtype additional_data: str + :keyword health_check_source: The name of the services called for the HealthCheck (I.E. + Test-AzureStack, Test-Cluster). + :paramtype health_check_source: str + """ + super().__init__(**kwargs) + self.name = name + self.tags = tags + self.title = title + self.status = status + self.severity = severity + self.description = description + self.remediation = remediation + self.target_resource_id = target_resource_id + self.target_resource_name = target_resource_name + self.timestamp = timestamp + self.additional_data = additional_data + self.health_check_source = health_check_source + + +class PrecheckResultTags(_serialization.Model): + """Key-value pairs that allow grouping/filtering individual tests. + + :ivar key: Key that allow grouping/filtering individual tests. + :vartype key: str + :ivar value: Value of the key that allow grouping/filtering individual tests. + :vartype value: str + """ + + _attribute_map = { + "key": {"key": "key", "type": "str"}, + "value": {"key": "value", "type": "str"}, + } + + def __init__(self, *, key: Optional[str] = None, value: Optional[str] = None, **kwargs): + """ + :keyword key: Key that allow grouping/filtering individual tests. + :paramtype key: str + :keyword value: Value of the key that allow grouping/filtering individual tests. + :paramtype value: str + """ + super().__init__(**kwargs) + self.key = key + self.value = value + + class Publisher(ProxyResource): """Publisher details. @@ -2050,7 +2228,9 @@ class Update(ProxyResource): # pylint: disable=too-many-instance-attributes :ivar location: The geo-location where the resource lives. :vartype location: str :ivar provisioning_state: Provisioning state of the Updates proxy resource. Known values are: - "Succeeded", "Failed", "Canceled", "Accepted", and "Provisioning". + "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", + "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", + "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState :ivar installed_date: Date that the update was installed. :vartype installed_date: ~datetime.datetime @@ -2065,6 +2245,18 @@ class Update(ProxyResource): # pylint: disable=too-many-instance-attributes :ivar prerequisites: If update State is HasPrerequisite, this property contains an array of objects describing prerequisite updates before installing this update. Otherwise, it is empty. :vartype prerequisites: list[~azure.mgmt.azurestackhci.models.UpdatePrerequisite] + :ivar component_versions: An array of component versions for a Solution Bundle update, and an + empty array otherwise. + :vartype component_versions: list[~azure.mgmt.azurestackhci.models.PackageVersionInfo] + :ivar reboot_required: Known values are: "Unknown", "True", and "False". + :vartype reboot_required: str or ~azure.mgmt.azurestackhci.models.RebootRequirement + :ivar health_state: Overall health state for update-specific health checks. Known values are: + "Unknown", "Success", "Failure", "Warning", "Error", and "InProgress". + :vartype health_state: str or ~azure.mgmt.azurestackhci.models.HealthState + :ivar health_check_result: An array of PrecheckResult objects. + :vartype health_check_result: list[~azure.mgmt.azurestackhci.models.PrecheckResult] + :ivar health_check_date: Last time the package-specific checks were run. + :vartype health_check_date: ~datetime.datetime :ivar package_path: Path where the update package is available. :vartype package_path: str :ivar package_size_in_mb: Size of the package. This value is a combination of the size from @@ -2115,6 +2307,11 @@ class Update(ProxyResource): # pylint: disable=too-many-instance-attributes "description": {"key": "properties.description", "type": "str"}, "state": {"key": "properties.state", "type": "str"}, "prerequisites": {"key": "properties.prerequisites", "type": "[UpdatePrerequisite]"}, + "component_versions": {"key": "properties.componentVersions", "type": "[PackageVersionInfo]"}, + "reboot_required": {"key": "properties.rebootRequired", "type": "str"}, + "health_state": {"key": "properties.healthState", "type": "str"}, + "health_check_result": {"key": "properties.healthCheckResult", "type": "[PrecheckResult]"}, + "health_check_date": {"key": "properties.healthCheckDate", "type": "iso-8601"}, "package_path": {"key": "properties.packagePath", "type": "str"}, "package_size_in_mb": {"key": "properties.packageSizeInMb", "type": "float"}, "display_name": {"key": "properties.displayName", "type": "str"}, @@ -2128,7 +2325,7 @@ class Update(ProxyResource): # pylint: disable=too-many-instance-attributes "notify_message": {"key": "properties.updateStateProperties.notifyMessage", "type": "str"}, } - def __init__( + def __init__( # pylint: disable=too-many-locals self, *, location: Optional[str] = None, @@ -2136,6 +2333,11 @@ def __init__( description: Optional[str] = None, state: Optional[Union[str, "_models.State"]] = None, prerequisites: Optional[List["_models.UpdatePrerequisite"]] = None, + component_versions: Optional[List["_models.PackageVersionInfo"]] = None, + reboot_required: Optional[Union[str, "_models.RebootRequirement"]] = None, + health_state: Optional[Union[str, "_models.HealthState"]] = None, + health_check_result: Optional[List["_models.PrecheckResult"]] = None, + health_check_date: Optional[datetime.datetime] = None, package_path: Optional[str] = None, package_size_in_mb: Optional[float] = None, display_name: Optional[str] = None, @@ -2165,6 +2367,18 @@ def __init__( :keyword prerequisites: If update State is HasPrerequisite, this property contains an array of objects describing prerequisite updates before installing this update. Otherwise, it is empty. :paramtype prerequisites: list[~azure.mgmt.azurestackhci.models.UpdatePrerequisite] + :keyword component_versions: An array of component versions for a Solution Bundle update, and + an empty array otherwise. + :paramtype component_versions: list[~azure.mgmt.azurestackhci.models.PackageVersionInfo] + :keyword reboot_required: Known values are: "Unknown", "True", and "False". + :paramtype reboot_required: str or ~azure.mgmt.azurestackhci.models.RebootRequirement + :keyword health_state: Overall health state for update-specific health checks. Known values + are: "Unknown", "Success", "Failure", "Warning", "Error", and "InProgress". + :paramtype health_state: str or ~azure.mgmt.azurestackhci.models.HealthState + :keyword health_check_result: An array of PrecheckResult objects. + :paramtype health_check_result: list[~azure.mgmt.azurestackhci.models.PrecheckResult] + :keyword health_check_date: Last time the package-specific checks were run. + :paramtype health_check_date: ~datetime.datetime :keyword package_path: Path where the update package is available. :paramtype package_path: str :keyword package_size_in_mb: Size of the package. This value is a combination of the size from @@ -2203,6 +2417,11 @@ def __init__( self.description = description self.state = state self.prerequisites = prerequisites + self.component_versions = component_versions + self.reboot_required = reboot_required + self.health_state = health_state + self.health_check_result = health_check_result + self.health_check_date = health_check_date self.package_path = package_path self.package_size_in_mb = package_size_in_mb self.display_name = display_name @@ -2304,8 +2523,14 @@ class UpdateRun(ProxyResource): # pylint: disable=too-many-instance-attributes :ivar location: The geo-location where the resource lives. :vartype location: str :ivar provisioning_state: Provisioning state of the UpdateRuns proxy resource. Known values - are: "Succeeded", "Failed", "Canceled", "Accepted", and "Provisioning". + are: "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", + "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", + "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState + :ivar time_started: Timestamp of the update run was started. + :vartype time_started: ~datetime.datetime + :ivar last_updated_time: Timestamp of the most recently completed step in the update run. + :vartype last_updated_time: ~datetime.datetime :ivar duration: Duration of the update run. :vartype duration: str :ivar state: State of the update run. Known values are: "Unknown", "Succeeded", "InProgress", @@ -2345,6 +2570,8 @@ class UpdateRun(ProxyResource): # pylint: disable=too-many-instance-attributes "system_data": {"key": "systemData", "type": "SystemData"}, "location": {"key": "location", "type": "str"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "time_started": {"key": "properties.timeStarted", "type": "iso-8601"}, + "last_updated_time": {"key": "properties.lastUpdatedTime", "type": "iso-8601"}, "duration": {"key": "properties.duration", "type": "str"}, "state": {"key": "properties.state", "type": "str"}, "name_properties_progress_name": {"key": "properties.progress.name", "type": "str"}, @@ -2361,6 +2588,8 @@ def __init__( self, *, location: Optional[str] = None, + time_started: Optional[datetime.datetime] = None, + last_updated_time: Optional[datetime.datetime] = None, duration: Optional[str] = None, state: Optional[Union[str, "_models.UpdateRunPropertiesState"]] = None, name_properties_progress_name: Optional[str] = None, @@ -2376,6 +2605,10 @@ def __init__( """ :keyword location: The geo-location where the resource lives. :paramtype location: str + :keyword time_started: Timestamp of the update run was started. + :paramtype time_started: ~datetime.datetime + :keyword last_updated_time: Timestamp of the most recently completed step in the update run. + :paramtype last_updated_time: ~datetime.datetime :keyword duration: Duration of the update run. :paramtype duration: str :keyword state: State of the update run. Known values are: "Unknown", "Succeeded", @@ -2402,6 +2635,8 @@ def __init__( super().__init__(**kwargs) self.location = location self.provisioning_state = None + self.time_started = time_started + self.last_updated_time = last_updated_time self.duration = duration self.state = state self.name_properties_progress_name = name_properties_progress_name @@ -2463,7 +2698,9 @@ class UpdateSummaries(ProxyResource): # pylint: disable=too-many-instance-attri :ivar location: The geo-location where the resource lives. :vartype location: str :ivar provisioning_state: Provisioning state of the UpdateSummaries proxy resource. Known - values are: "Succeeded", "Failed", "Canceled", "Accepted", and "Provisioning". + values are: "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", + "Disconnected", "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", + "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState :ivar oem_family: OEM family name. :vartype oem_family: str @@ -2473,6 +2710,17 @@ class UpdateSummaries(ProxyResource): # pylint: disable=too-many-instance-attri :vartype package_versions: list[~azure.mgmt.azurestackhci.models.PackageVersionInfo] :ivar current_version: Current Solution Bundle version of the stamp. :vartype current_version: str + :ivar last_updated: Last time an update installation completed successfully. + :vartype last_updated: ~datetime.datetime + :ivar last_checked: Last time the update service successfully checked for updates. + :vartype last_checked: ~datetime.datetime + :ivar health_state: Overall health state for update-specific health checks. Known values are: + "Unknown", "Success", "Failure", "Warning", "Error", and "InProgress". + :vartype health_state: str or ~azure.mgmt.azurestackhci.models.HealthState + :ivar health_check_result: An array of pre-check result objects. + :vartype health_check_result: list[~azure.mgmt.azurestackhci.models.PrecheckResult] + :ivar health_check_date: Last time the package-specific checks were run. + :vartype health_check_date: ~datetime.datetime :ivar state: Overall update state of the stamp. Known values are: "Unknown", "AppliedSuccessfully", "UpdateAvailable", "UpdateInProgress", "UpdateFailed", "NeedsAttention", "PreparationInProgress", and "PreparationFailed". @@ -2498,6 +2746,11 @@ class UpdateSummaries(ProxyResource): # pylint: disable=too-many-instance-attri "hardware_model": {"key": "properties.hardwareModel", "type": "str"}, "package_versions": {"key": "properties.packageVersions", "type": "[PackageVersionInfo]"}, "current_version": {"key": "properties.currentVersion", "type": "str"}, + "last_updated": {"key": "properties.lastUpdated", "type": "iso-8601"}, + "last_checked": {"key": "properties.lastChecked", "type": "iso-8601"}, + "health_state": {"key": "properties.healthState", "type": "str"}, + "health_check_result": {"key": "properties.healthCheckResult", "type": "[PrecheckResult]"}, + "health_check_date": {"key": "properties.healthCheckDate", "type": "iso-8601"}, "state": {"key": "properties.state", "type": "str"}, } @@ -2509,6 +2762,11 @@ def __init__( hardware_model: Optional[str] = None, package_versions: Optional[List["_models.PackageVersionInfo"]] = None, current_version: Optional[str] = None, + last_updated: Optional[datetime.datetime] = None, + last_checked: Optional[datetime.datetime] = None, + health_state: Optional[Union[str, "_models.HealthState"]] = None, + health_check_result: Optional[List["_models.PrecheckResult"]] = None, + health_check_date: Optional[datetime.datetime] = None, state: Optional[Union[str, "_models.UpdateSummariesPropertiesState"]] = None, **kwargs ): @@ -2523,6 +2781,17 @@ def __init__( :paramtype package_versions: list[~azure.mgmt.azurestackhci.models.PackageVersionInfo] :keyword current_version: Current Solution Bundle version of the stamp. :paramtype current_version: str + :keyword last_updated: Last time an update installation completed successfully. + :paramtype last_updated: ~datetime.datetime + :keyword last_checked: Last time the update service successfully checked for updates. + :paramtype last_checked: ~datetime.datetime + :keyword health_state: Overall health state for update-specific health checks. Known values + are: "Unknown", "Success", "Failure", "Warning", "Error", and "InProgress". + :paramtype health_state: str or ~azure.mgmt.azurestackhci.models.HealthState + :keyword health_check_result: An array of pre-check result objects. + :paramtype health_check_result: list[~azure.mgmt.azurestackhci.models.PrecheckResult] + :keyword health_check_date: Last time the package-specific checks were run. + :paramtype health_check_date: ~datetime.datetime :keyword state: Overall update state of the stamp. Known values are: "Unknown", "AppliedSuccessfully", "UpdateAvailable", "UpdateInProgress", "UpdateFailed", "NeedsAttention", "PreparationInProgress", and "PreparationFailed". @@ -2535,6 +2804,11 @@ def __init__( self.hardware_model = hardware_model self.package_versions = package_versions self.current_version = current_version + self.last_updated = last_updated + self.last_checked = last_checked + self.health_state = health_state + self.health_check_result = health_check_result + self.health_check_date = health_check_date self.state = state diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/__init__.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/__init__.py index cf0e7fd20bfd..4f2531a63b22 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/__init__.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/__init__.py @@ -9,8 +9,8 @@ from ._arc_settings_operations import ArcSettingsOperations from ._clusters_operations import ClustersOperations from ._extensions_operations import ExtensionsOperations -from ._operations import Operations from ._offers_operations import OffersOperations +from ._operations import Operations from ._publishers_operations import PublishersOperations from ._skus_operations import SkusOperations from ._update_runs_operations import UpdateRunsOperations @@ -25,8 +25,8 @@ "ArcSettingsOperations", "ClustersOperations", "ExtensionsOperations", - "Operations", "OffersOperations", + "Operations", "PublishersOperations", "SkusOperations", "UpdateRunsOperations", 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 5e6fc1e24004..8abd15eb017a 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 @@ -49,7 +49,7 @@ def build_list_by_cluster_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -82,7 +82,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -116,7 +116,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -153,7 +153,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -190,7 +190,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +224,7 @@ def build_generate_password_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -258,7 +258,7 @@ def build_create_identity_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -324,7 +324,7 @@ def list_by_cluster( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.ArcSettingList] = kwargs.pop("cls", None) @@ -428,7 +428,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) @@ -575,7 +575,7 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -732,7 +732,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -798,7 +798,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -863,7 +863,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -938,7 +938,7 @@ def generate_password( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.PasswordCredential] = kwargs.pop("cls", None) @@ -992,7 +992,7 @@ def _create_identity_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[Optional[_models.ArcIdentityResponse]] = kwargs.pop("cls", None) @@ -1064,7 +1064,7 @@ def begin_create_identity( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.ArcIdentityResponse] = kwargs.pop("cls", None) 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 7cd75ec9babd..1c860d401ba2 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 @@ -47,7 +47,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -101,7 +101,7 @@ def build_get_request(resource_group_name: str, cluster_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -134,7 +134,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -170,7 +170,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -206,7 +206,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -239,7 +239,7 @@ def build_upload_certificate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -275,7 +275,7 @@ def build_create_identity_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -308,7 +308,7 @@ def build_extend_software_assurance_benefit_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -369,7 +369,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.Cluster"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.ClusterList] = kwargs.pop("cls", None) @@ -456,7 +456,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.ClusterList] = kwargs.pop("cls", None) @@ -554,7 +554,7 @@ def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) @@ -681,7 +681,7 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -820,7 +820,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -885,7 +885,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -944,7 +944,7 @@ def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -1004,7 +1004,7 @@ def _upload_certificate_initial( # pylint: disable=inconsistent-return-statemen _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -1158,7 +1158,7 @@ def begin_upload_certificate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -1219,7 +1219,7 @@ def _create_identity_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[Optional[_models.ClusterIdentityResponse]] = kwargs.pop("cls", None) @@ -1287,7 +1287,7 @@ def begin_create_identity( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.ClusterIdentityResponse] = kwargs.pop("cls", None) @@ -1351,7 +1351,7 @@ def _extend_software_assurance_benefit_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -1512,7 +1512,7 @@ def begin_extend_software_assurance_benefit( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) 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 613ad8202a82..ed2c68b365b1 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 @@ -49,7 +49,7 @@ def build_list_by_arc_setting_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +88,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -128,7 +128,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -171,7 +171,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -214,7 +214,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -284,7 +284,7 @@ def list_by_arc_setting( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.ExtensionList] = kwargs.pop("cls", None) @@ -391,7 +391,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.Extension] = kwargs.pop("cls", None) @@ -452,7 +452,7 @@ def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -636,7 +636,7 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -707,7 +707,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -889,7 +889,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) @@ -954,7 +954,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -1022,7 +1022,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_offers_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_offers_operations.py index 38afc93b3920..7841e5ffe828 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_offers_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_offers_operations.py @@ -53,7 +53,7 @@ def build_list_by_publisher_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -89,7 +89,7 @@ def build_list_by_cluster_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -131,7 +131,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +210,7 @@ def list_by_publisher( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OfferList] = kwargs.pop("cls", None) @@ -308,7 +308,7 @@ def list_by_cluster( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OfferList] = kwargs.pop("cls", None) @@ -423,7 +423,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.Offer] = kwargs.pop("cls", None) 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 2cfa419e4dab..14702bf25d1a 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 @@ -43,7 +43,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,7 @@ def list(self, **kwargs: Any) -> _models.OperationListResult: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_publishers_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_publishers_operations.py index 0d3c7b0e1b98..e06093fbae5a 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_publishers_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_publishers_operations.py @@ -47,7 +47,7 @@ def build_list_by_cluster_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,7 +80,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def list_by_cluster( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.PublisherList] = kwargs.pop("cls", None) @@ -247,7 +247,7 @@ def get(self, resource_group_name: str, cluster_name: str, publisher_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.Publisher] = kwargs.pop("cls", None) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_skus_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_skus_operations.py index 98a64a0b1a78..25ab4d7124ae 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_skus_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_skus_operations.py @@ -54,7 +54,7 @@ def build_list_by_offer_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,7 +99,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -182,7 +182,7 @@ def list_by_offer( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.SkuList] = kwargs.pop("cls", None) @@ -302,7 +302,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.Sku] = kwargs.pop("cls", None) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_update_runs_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_update_runs_operations.py index e8dcfe1b760a..c3f091db66bb 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_update_runs_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_update_runs_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -21,10 +21,12 @@ 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.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models from .._serialization import Serializer @@ -47,7 +49,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,6 +77,89 @@ def build_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_delete_request( + resource_group_name: str, + cluster_name: str, + update_name: str, + update_run_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}", + ) # pylint: disable=line-too-long + 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"), + "updateName": _SERIALIZER.url("update_name", update_name, "str"), + "updateRunName": _SERIALIZER.url("update_run_name", update_run_name, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_put_request( + resource_group_name: str, + cluster_name: str, + update_name: str, + update_run_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}", + ) # pylint: disable=line-too-long + 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"), + "updateName": _SERIALIZER.url("update_name", update_name, "str"), + "updateRunName": _SERIALIZER.url("update_run_name", update_run_name, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + def build_get_request( resource_group_name: str, cluster_name: str, @@ -86,7 +171,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -155,7 +240,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.UpdateRunList] = kwargs.pop("cls", None) @@ -230,11 +315,308 @@ def get_next(next_link=None): "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns" } + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + update_run_name=update_run_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}" + } + + @distributed_trace + def begin_delete( + self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete specified Update Run. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + update_run_name=update_run_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, 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, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}" + } + + @overload + def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_run_name: str, + update_runs_properties: _models.UpdateRun, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.UpdateRun: + """Put Update runs for a specified update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :param update_runs_properties: Properties of the updateRuns object. Required. + :type update_runs_properties: ~azure.mgmt.azurestackhci.models.UpdateRun + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpdateRun or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_run_name: str, + update_runs_properties: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.UpdateRun: + """Put Update runs for a specified update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :param update_runs_properties: Properties of the updateRuns object. Required. + :type update_runs_properties: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpdateRun or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_run_name: str, + update_runs_properties: Union[_models.UpdateRun, IO], + **kwargs: Any + ) -> _models.UpdateRun: + """Put Update runs for a specified update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :param update_runs_properties: Properties of the updateRuns object. Is either a model type or a + IO type. Required. + :type update_runs_properties: ~azure.mgmt.azurestackhci.models.UpdateRun or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpdateRun or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateRun] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(update_runs_properties, (IO, bytes)): + _content = update_runs_properties + else: + _json = self._serialize.body(update_runs_properties, "UpdateRun") + + request = build_put_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + update_run_name=update_run_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.put.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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("UpdateRun", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + put.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}" + } + @distributed_trace def get( self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any ) -> _models.UpdateRun: - """List all Update runs for a specified update. + """Get the Update run for a specified update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -261,7 +643,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.UpdateRun] = kwargs.pop("cls", None) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_update_summaries_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_update_summaries_operations.py index 9b6799d5e43f..5e798beb4b8a 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_update_summaries_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_update_summaries_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -21,10 +21,12 @@ 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.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models from .._serialization import Serializer @@ -45,7 +47,7 @@ def build_list_request(resource_group_name: str, cluster_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,11 +74,78 @@ def build_list_request(resource_group_name: str, cluster_name: str, subscription return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_delete_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default", + ) # pylint: disable=line-too-long + 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: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_put_request(resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default", + ) # pylint: disable=line-too-long + 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: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + def build_get_request(resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -139,7 +208,7 @@ def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> It _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.UpdateSummariesList] = kwargs.pop("cls", None) @@ -213,6 +282,273 @@ def get_next(next_link=None): "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries" } + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default" + } + + @distributed_trace + def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete Update Summaries. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_name=cluster_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, 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, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default" + } + + @overload + def put( + self, + resource_group_name: str, + cluster_name: str, + update_location_properties: _models.UpdateSummaries, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.UpdateSummaries: + """Put Update summaries under the HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_location_properties: Properties of the UpdateSummaries resource. Required. + :type update_location_properties: ~azure.mgmt.azurestackhci.models.UpdateSummaries + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpdateSummaries or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def put( + self, + resource_group_name: str, + cluster_name: str, + update_location_properties: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.UpdateSummaries: + """Put Update summaries under the HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_location_properties: Properties of the UpdateSummaries resource. Required. + :type update_location_properties: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpdateSummaries or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def put( + self, + resource_group_name: str, + cluster_name: str, + update_location_properties: Union[_models.UpdateSummaries, IO], + **kwargs: Any + ) -> _models.UpdateSummaries: + """Put Update summaries under the HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_location_properties: Properties of the UpdateSummaries resource. Is either a + model type or a IO type. Required. + :type update_location_properties: ~azure.mgmt.azurestackhci.models.UpdateSummaries or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UpdateSummaries or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateSummaries] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(update_location_properties, (IO, bytes)): + _content = update_location_properties + else: + _json = self._serialize.body(update_location_properties, "UpdateSummaries") + + request = build_put_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.put.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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("UpdateSummaries", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + put.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default" + } + @distributed_trace def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.UpdateSummaries: """Get all Update summaries under the HCI cluster. @@ -238,7 +574,7 @@ def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.UpdateSummaries] = kwargs.pop("cls", None) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_updates_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_updates_operations.py index 87bde362040f..83ece6fd77eb 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_updates_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_updates_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -49,7 +49,7 @@ def build_post_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,7 +81,7 @@ def build_list_request(resource_group_name: str, cluster_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,13 +108,84 @@ def build_list_request(resource_group_name: str, cluster_name: str, subscription return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_delete_request( + resource_group_name: str, cluster_name: str, update_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}", + ) # pylint: disable=line-too-long + 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"), + "updateName": _SERIALIZER.url("update_name", update_name, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_put_request( + resource_group_name: str, cluster_name: str, update_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}", + ) # pylint: disable=line-too-long + 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"), + "updateName": _SERIALIZER.url("update_name", update_name, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + def build_get_request( resource_group_name: str, cluster_name: str, update_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: Literal["2022-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +246,7 @@ def _post_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -204,8 +275,14 @@ def _post_initial( # pylint: disable=inconsistent-return-statements error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) _post_initial.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/apply" @@ -239,7 +316,7 @@ def begin_post( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[None] = kwargs.pop("cls", None) @@ -265,7 +342,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- if polling is True: polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) @@ -301,7 +378,7 @@ def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> It _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.UpdateList] = kwargs.pop("cls", None) @@ -375,6 +452,289 @@ def get_next(next_link=None): "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates" } + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}" + } + + @distributed_trace + def begin_delete( + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete specified Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, 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, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}" + } + + @overload + def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_properties: _models.Update, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Update: + """Put specified Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_properties: Properties of the Updates object. Required. + :type update_properties: ~azure.mgmt.azurestackhci.models.Update + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Update or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.Update + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_properties: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Update: + """Put specified Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_properties: Properties of the Updates object. Required. + :type update_properties: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Update or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.Update + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_properties: Union[_models.Update, IO], + **kwargs: Any + ) -> _models.Update: + """Put specified Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_properties: Properties of the Updates object. Is either a model type or a IO + type. Required. + :type update_properties: ~azure.mgmt.azurestackhci.models.Update or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Update or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.Update + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-12-01"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Update] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(update_properties, (IO, bytes)): + _content = update_properties + else: + _json = self._serialize.body(update_properties, "Update") + + request = build_put_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.put.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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("Update", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + put.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}" + } + @distributed_trace def get(self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any) -> _models.Update: """Get specified Update. @@ -402,7 +762,7 @@ def get(self, resource_group_name: str, cluster_name: str, update_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-10-01"] = kwargs.pop( + api_version: Literal["2022-12-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) ) cls: ClsType[_models.Update] = kwargs.pop("cls", None) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_arc_identity.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_arc_identity.py index 71dcbb174bca..effdf9c2304e 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_arc_identity.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_arc_identity.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/CreateArcIdentity.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/CreateArcIdentity.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster.py index e0bee95000d5..6bdbb9281781 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/CreateCluster.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/CreateCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster_identity.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster_identity.py index 67e3f65b3b4c..e0c0bc0cb6bc 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster_identity.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster_identity.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/CreateClusterIdentity.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/CreateClusterIdentity.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_arc_setting.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_arc_setting.py index 5d26c85e5ad1..cabd495714af 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_arc_setting.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_arc_setting.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/DeleteArcSetting.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/DeleteArcSetting.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_cluster.py index 2d965236d7f9..79c3fcfc239c 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_cluster.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/DeleteCluster.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/DeleteCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_extension.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_extension.py index 6f1f2c415540..961b54baa485 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_extension.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_extension.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/DeleteExtension.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/DeleteExtension.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_runs.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_runs.py new file mode 100644 index 000000000000..776109fc146a --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_runs.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python delete_update_runs.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="b8d594e5-51f3-4c11-9c54-a7771b81c712", + ) + + response = client.update_runs.begin_delete( + resource_group_name="testrg", + cluster_name="testcluster", + update_name="Microsoft4.2203.2.32", + update_run_name="23b779ba-0d52-4a80-8571-45ca74664ec3", + ).result() + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/DeleteUpdateRuns.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_summaries.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_summaries.py new file mode 100644 index 000000000000..6f3093313684 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_summaries.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python delete_update_summaries.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="b8d594e5-51f3-4c11-9c54-a7771b81c712", + ) + + response = client.update_summaries.begin_delete( + resource_group_name="testrg", + cluster_name="testcluster", + ).result() + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/DeleteUpdateSummaries.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_updates.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_updates.py new file mode 100644 index 000000000000..68c3bd1233ea --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_updates.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python delete_updates.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="b8d594e5-51f3-4c11-9c54-a7771b81c712", + ) + + response = client.updates.begin_delete( + resource_group_name="testrg", + cluster_name="testcluster", + update_name="Microsoft4.2203.2.32", + ).result() + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/DeleteUpdates.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extend_software_assurance_benefit.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extend_software_assurance_benefit.py index 255b1209aaff..37bea251f0cb 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extend_software_assurance_benefit.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extend_software_assurance_benefit.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ExtendSoftwareAssuranceBenefit.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ExtendSoftwareAssuranceBenefit.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/generate_password.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/generate_password.py index 2b0eeb49024b..78a7bbfa1c3c 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/generate_password.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/generate_password.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/GeneratePassword.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GeneratePassword.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_arc_setting.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_arc_setting.py index 8b3415ca5005..770c243a91c3 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_arc_setting.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_arc_setting.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/GetArcSetting.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetArcSetting.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_cluster.py index 03592a932fb8..cb3b35c2b5fc 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_cluster.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/GetCluster.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_extension.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_extension.py index e73a784ad36e..18358a29c292 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_extension.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_extension.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/GetExtension.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetExtension.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_offer.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_offer.py index 71c6ad96ed3f..7678b043ff56 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_offer.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_offer.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/GetOffer.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetOffer.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_publisher.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_publisher.py index 9076f77852d4..c265c024ba11 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_publisher.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_publisher.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/GetPublisher.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetPublisher.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_sku.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_sku.py index 1e1b91cf9845..994568ffa5dc 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_sku.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_sku.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/GetSku.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetSku.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_runs.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_runs.py index 56e430f75d98..ea853df1dba8 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_runs.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_runs.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/GetUpdateRuns.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetUpdateRuns.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_summaries.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_summaries.py index 0a630ab5dae4..1cc08133d649 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_summaries.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_summaries.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/GetUpdateSummaries.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetUpdateSummaries.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_updates.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_updates.py index 0d54a864af2a..f4f07ab41e52 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_updates.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_updates.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/GetUpdates.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/GetUpdates.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_arc_settings_by_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_arc_settings_by_cluster.py index 5ecce19cbe8a..371dc983c0ca 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_arc_settings_by_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_arc_settings_by_cluster.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ListArcSettingsByCluster.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListArcSettingsByCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_resource_group.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_resource_group.py index 41d7ffe4e5b2..a5dbee9b280c 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_resource_group.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_resource_group.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ListClustersByResourceGroup.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListClustersByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_subscription.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_subscription.py index a645aa1f5d49..6c5de57f965a 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_subscription.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_subscription.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ListClustersBySubscription.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListClustersBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_extensions_by_arc_setting.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_extensions_by_arc_setting.py index fe7419993331..863de81e1d8f 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_extensions_by_arc_setting.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_extensions_by_arc_setting.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ListExtensionsByArcSetting.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListExtensionsByArcSetting.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_cluster.py index 371045569842..af7c1cac0af9 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_cluster.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ListOffersByCluster.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListOffersByCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_publisher.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_publisher.py index c8cc54d99745..159289cea3ca 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_publisher.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_publisher.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ListOffersByPublisher.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListOffersByPublisher.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_operations.py index 3ccaa9f5fce6..004f5fab650e 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_operations.py @@ -33,6 +33,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ListOperations.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListOperations.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_publishers_by_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_publishers_by_cluster.py index 139900f95961..b4044163ebb7 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_publishers_by_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_publishers_by_cluster.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ListPublishersByCluster.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListPublishersByCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_skus_by_offer.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_skus_by_offer.py index 2d6b2f92a826..ad0adff89d7d 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_skus_by_offer.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_skus_by_offer.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ListSkusByOffer.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListSkusByOffer.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_runs.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_runs.py index 76224235dd9b..903eb9161b80 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_runs.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_runs.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ListUpdateRuns.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListUpdateRuns.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_summaries.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_summaries.py index e000ac2e9f42..25a35ade898f 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_summaries.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_summaries.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ListUpdateSummaries.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListUpdateSummaries.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_updates.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_updates.py index fc66254688c7..a30edf8b0cee 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_updates.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_updates.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ListUpdates.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/ListUpdates.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_arc_setting.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_arc_setting.py index 66e8751654de..a5d2d18d2c30 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_arc_setting.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_arc_setting.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/PatchArcSetting.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PatchArcSetting.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_extension.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_extension.py index fab222a7a446..c4482828bc69 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_extension.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_extension.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/PatchExtension.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PatchExtension.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/post_updates.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/post_updates.py index 4270cf28b1db..7868b21754a1 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/post_updates.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/post_updates.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/PostUpdates.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PostUpdates.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_extension.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_extension.py index 8d5a301d2ce4..6f6920fefb29 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_extension.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_extension.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/PutExtension.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PutExtension.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_runs.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_runs.py new file mode 100644 index 000000000000..6c2997285375 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_runs.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python put_update_runs.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="b8d594e5-51f3-4c11-9c54-a7771b81c712", + ) + + response = client.update_runs.put( + resource_group_name="testrg", + cluster_name="testcluster", + update_name="Microsoft4.2203.2.32", + update_run_name="23b779ba-0d52-4a80-8571-45ca74664ec3", + update_runs_properties={ + "properties": { + "progress": { + "description": "Update Azure Stack.", + "endTimeUtc": "2022-04-06T13:58:42.969006+00:00", + "errorMessage": "", + "lastUpdatedTimeUtc": "2022-04-06T13:58:42.969006+00:00", + "name": "Unnamed step", + "startTimeUtc": "2022-04-06T01:36:33.3876751+00:00", + "status": "Success", + "steps": [ + { + "description": "Prepare for SSU update", + "endTimeUtc": "2022-04-06T01:37:16.8728314+00:00", + "errorMessage": "", + "lastUpdatedTimeUtc": "2022-04-06T01:37:16.8728314+00:00", + "name": "PreUpdate Cloud", + "startTimeUtc": "2022-04-06T01:36:33.3876751+00:00", + "status": "Success", + "steps": [], + } + ], + } + } + }, + ) + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PutUpdateRuns.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_summaries.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_summaries.py new file mode 100644 index 000000000000..6cd8104c09c1 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_summaries.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python put_update_summaries.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="b8d594e5-51f3-4c11-9c54-a7771b81c712", + ) + + response = client.update_summaries.put( + resource_group_name="testrg", + cluster_name="testcluster", + update_location_properties={ + "properties": { + "currentVersion": "4.2203.2.32", + "hardwareModel": "PowerEdge R730xd", + "lastChecked": "2022-04-07T18:04:07Z", + "lastUpdated": "2022-04-06T14:08:18.254Z", + "oemFamily": "DellEMC", + "state": "AppliedSuccessfully", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PutUpdateSummaries.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_updates.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_updates.py new file mode 100644 index 000000000000..6fa8c893bd90 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_updates.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python put_updates.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="b8d594e5-51f3-4c11-9c54-a7771b81c712", + ) + + response = client.updates.put( + resource_group_name="testrg", + cluster_name="testcluster", + update_name="Microsoft4.2203.2.32", + update_properties={ + "properties": { + "additionalProperties": "additional properties", + "availabilityType": "Local", + "description": "AzS Update 4.2203.2.32", + "displayName": "AzS Update - 4.2203.2.32", + "installedDate": "2022-04-06T14:08:18.254Z", + "packagePath": "\\\\SU1FileServer\\SU1_Infrastructure_2\\Updates\\Packages\\Microsoft4.2203.2.32", + "packageSizeInMb": 18858, + "packageType": "Infrastructure", + "prerequisites": [ + { + "packageName": "update package name", + "updateType": "update type", + "version": "prerequisite version", + } + ], + "publisher": "Microsoft", + "releaseLink": "https://docs.microsoft.com/azure-stack/operator/release-notes?view=azs-2203", + "state": "Installed", + "updateStateProperties": { + "notifyMessage": "Brief message with instructions for updates of AvailabilityType Notify", + "progressPercentage": 0, + }, + "version": "4.2203.2.32", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/PutUpdates.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_cluster.py index d0fd87ad7eef..77b93cafd5fd 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_cluster.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/UpdateCluster.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/UpdateCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/upload_certificate.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/upload_certificate.py index 61333666182b..c978152209db 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/upload_certificate.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/upload_certificate.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/UploadCertificate.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-12-01/examples/UploadCertificate.json if __name__ == "__main__": main()