Skip to content

Commit 445a18b

Browse files
azure-sdkChenxiJiang333msyyc
authored
[AutoRelease] t2-azurestackhci-2024-08-16-34992(can only be merged by SDK owner) (#36924)
* code and test * update-testcase * update-version * Update CHANGELOG.md * Update CHANGELOG.md --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <[email protected]> Co-authored-by: ChenxiJiang333 <[email protected]> Co-authored-by: Yuchao Yan <[email protected]>
1 parent 252b227 commit 445a18b

File tree

172 files changed

+28063
-20128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+28063
-20128
lines changed

sdk/azurestackhci/azure-mgmt-azurestackhci/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Azure Stack HCI Management Client Library.
4-
This package has been tested with Python 3.7+.
4+
This package has been tested with Python 3.8+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.7+ is required to use this package.
15+
- Python 3.8+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "43c5786b7d90124e46fe068894694ac899965948",
2+
"commit": "c9b146c38df5f76e2d34a3ef771979805ff4ff73",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.7",
4+
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.7.1",
7-
"@autorest/modelerfour@4.26.2"
6+
"@autorest/python@6.17.0",
7+
"@autorest/modelerfour@4.27.0"
88
],
9-
"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.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False",
10-
"readme": "specification/azurestackhci/resource-manager/readme.md"
9+
"autorest_command": "autorest specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/readme.md --generate-sample=True --generate-test=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.17.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
10+
"readme": "specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/readme.md"
1111
}

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

Lines changed: 77 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,30 @@
88

99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
11+
from typing_extensions import Self
1112

13+
from azure.core.pipeline import policies
1214
from azure.core.rest import HttpRequest, HttpResponse
1315
from azure.mgmt.core import ARMPipelineClient
16+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1417

1518
from . import models as _models
1619
from ._configuration import AzureStackHCIClientConfiguration
1720
from ._serialization import Deserializer, Serializer
1821
from .operations import (
19-
GalleryImagesOperations,
20-
GuestAgentOperations,
21-
GuestAgentsOperations,
22-
HybridIdentityMetadataOperations,
23-
LogicalNetworksOperations,
24-
MarketplaceGalleryImagesOperations,
25-
NetworkInterfacesOperations,
22+
ArcSettingsOperations,
23+
ClustersOperations,
24+
DeploymentSettingsOperations,
25+
EdgeDevicesOperations,
26+
ExtensionsOperations,
27+
OffersOperations,
2628
Operations,
27-
StorageContainersOperations,
28-
VirtualHardDisksOperations,
29-
VirtualMachineInstancesOperations,
29+
PublishersOperations,
30+
SecuritySettingsOperations,
31+
SkusOperations,
32+
UpdateRunsOperations,
33+
UpdateSummariesOperations,
34+
UpdatesOperations,
3035
)
3136

3237
if TYPE_CHECKING:
@@ -37,39 +42,40 @@
3742
class AzureStackHCIClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
3843
"""Azure Stack HCI management service.
3944
40-
:ivar gallery_images: GalleryImagesOperations operations
41-
:vartype gallery_images: azure.mgmt.azurestackhci.operations.GalleryImagesOperations
45+
:ivar arc_settings: ArcSettingsOperations operations
46+
:vartype arc_settings: azure.mgmt.azurestackhci.operations.ArcSettingsOperations
47+
:ivar clusters: ClustersOperations operations
48+
:vartype clusters: azure.mgmt.azurestackhci.operations.ClustersOperations
49+
:ivar deployment_settings: DeploymentSettingsOperations operations
50+
:vartype deployment_settings: azure.mgmt.azurestackhci.operations.DeploymentSettingsOperations
51+
:ivar edge_devices: EdgeDevicesOperations operations
52+
:vartype edge_devices: azure.mgmt.azurestackhci.operations.EdgeDevicesOperations
53+
:ivar extensions: ExtensionsOperations operations
54+
:vartype extensions: azure.mgmt.azurestackhci.operations.ExtensionsOperations
55+
:ivar offers: OffersOperations operations
56+
:vartype offers: azure.mgmt.azurestackhci.operations.OffersOperations
4257
:ivar operations: Operations operations
4358
:vartype operations: azure.mgmt.azurestackhci.operations.Operations
44-
:ivar logical_networks: LogicalNetworksOperations operations
45-
:vartype logical_networks: azure.mgmt.azurestackhci.operations.LogicalNetworksOperations
46-
:ivar marketplace_gallery_images: MarketplaceGalleryImagesOperations operations
47-
:vartype marketplace_gallery_images:
48-
azure.mgmt.azurestackhci.operations.MarketplaceGalleryImagesOperations
49-
:ivar network_interfaces: NetworkInterfacesOperations operations
50-
:vartype network_interfaces: azure.mgmt.azurestackhci.operations.NetworkInterfacesOperations
51-
:ivar storage_containers: StorageContainersOperations operations
52-
:vartype storage_containers: azure.mgmt.azurestackhci.operations.StorageContainersOperations
53-
:ivar virtual_hard_disks: VirtualHardDisksOperations operations
54-
:vartype virtual_hard_disks: azure.mgmt.azurestackhci.operations.VirtualHardDisksOperations
55-
:ivar virtual_machine_instances: VirtualMachineInstancesOperations operations
56-
:vartype virtual_machine_instances:
57-
azure.mgmt.azurestackhci.operations.VirtualMachineInstancesOperations
58-
:ivar hybrid_identity_metadata: HybridIdentityMetadataOperations operations
59-
:vartype hybrid_identity_metadata:
60-
azure.mgmt.azurestackhci.operations.HybridIdentityMetadataOperations
61-
:ivar guest_agent: GuestAgentOperations operations
62-
:vartype guest_agent: azure.mgmt.azurestackhci.operations.GuestAgentOperations
63-
:ivar guest_agents: GuestAgentsOperations operations
64-
:vartype guest_agents: azure.mgmt.azurestackhci.operations.GuestAgentsOperations
59+
:ivar publishers: PublishersOperations operations
60+
:vartype publishers: azure.mgmt.azurestackhci.operations.PublishersOperations
61+
:ivar security_settings: SecuritySettingsOperations operations
62+
:vartype security_settings: azure.mgmt.azurestackhci.operations.SecuritySettingsOperations
63+
:ivar skus: SkusOperations operations
64+
:vartype skus: azure.mgmt.azurestackhci.operations.SkusOperations
65+
:ivar update_runs: UpdateRunsOperations operations
66+
:vartype update_runs: azure.mgmt.azurestackhci.operations.UpdateRunsOperations
67+
:ivar update_summaries: UpdateSummariesOperations operations
68+
:vartype update_summaries: azure.mgmt.azurestackhci.operations.UpdateSummariesOperations
69+
:ivar updates: UpdatesOperations operations
70+
:vartype updates: azure.mgmt.azurestackhci.operations.UpdatesOperations
6571
:param credential: Credential needed for the client to connect to Azure. Required.
6672
:type credential: ~azure.core.credentials.TokenCredential
67-
:param subscription_id: The ID of the target subscription. Required.
73+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
6874
:type subscription_id: str
6975
:param base_url: Service URL. Default value is "https://management.azure.com".
7076
:type base_url: str
71-
:keyword api_version: Api Version. Default value is "2023-09-01-preview". Note that overriding
72-
this default value may result in unsupported behavior.
77+
:keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this
78+
default value may result in unsupported behavior.
7379
:paramtype api_version: str
7480
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
7581
Retry-After header is present.
@@ -85,39 +91,51 @@ def __init__(
8591
self._config = AzureStackHCIClientConfiguration(
8692
credential=credential, subscription_id=subscription_id, **kwargs
8793
)
88-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
94+
_policies = kwargs.pop("policies", None)
95+
if _policies is None:
96+
_policies = [
97+
policies.RequestIdPolicy(**kwargs),
98+
self._config.headers_policy,
99+
self._config.user_agent_policy,
100+
self._config.proxy_policy,
101+
policies.ContentDecodePolicy(**kwargs),
102+
ARMAutoResourceProviderRegistrationPolicy(),
103+
self._config.redirect_policy,
104+
self._config.retry_policy,
105+
self._config.authentication_policy,
106+
self._config.custom_hook_policy,
107+
self._config.logging_policy,
108+
policies.DistributedTracingPolicy(**kwargs),
109+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
110+
self._config.http_logging_policy,
111+
]
112+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
89113

90114
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
91115
self._serialize = Serializer(client_models)
92116
self._deserialize = Deserializer(client_models)
93117
self._serialize.client_side_validation = False
94-
self.gallery_images = GalleryImagesOperations(self._client, self._config, self._serialize, self._deserialize)
95-
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
96-
self.logical_networks = LogicalNetworksOperations(
97-
self._client, self._config, self._serialize, self._deserialize
98-
)
99-
self.marketplace_gallery_images = MarketplaceGalleryImagesOperations(
100-
self._client, self._config, self._serialize, self._deserialize
101-
)
102-
self.network_interfaces = NetworkInterfacesOperations(
118+
self.arc_settings = ArcSettingsOperations(self._client, self._config, self._serialize, self._deserialize)
119+
self.clusters = ClustersOperations(self._client, self._config, self._serialize, self._deserialize)
120+
self.deployment_settings = DeploymentSettingsOperations(
103121
self._client, self._config, self._serialize, self._deserialize
104122
)
105-
self.storage_containers = StorageContainersOperations(
106-
self._client, self._config, self._serialize, self._deserialize
107-
)
108-
self.virtual_hard_disks = VirtualHardDisksOperations(
109-
self._client, self._config, self._serialize, self._deserialize
110-
)
111-
self.virtual_machine_instances = VirtualMachineInstancesOperations(
123+
self.edge_devices = EdgeDevicesOperations(self._client, self._config, self._serialize, self._deserialize)
124+
self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize)
125+
self.offers = OffersOperations(self._client, self._config, self._serialize, self._deserialize)
126+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
127+
self.publishers = PublishersOperations(self._client, self._config, self._serialize, self._deserialize)
128+
self.security_settings = SecuritySettingsOperations(
112129
self._client, self._config, self._serialize, self._deserialize
113130
)
114-
self.hybrid_identity_metadata = HybridIdentityMetadataOperations(
131+
self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize)
132+
self.update_runs = UpdateRunsOperations(self._client, self._config, self._serialize, self._deserialize)
133+
self.update_summaries = UpdateSummariesOperations(
115134
self._client, self._config, self._serialize, self._deserialize
116135
)
117-
self.guest_agent = GuestAgentOperations(self._client, self._config, self._serialize, self._deserialize)
118-
self.guest_agents = GuestAgentsOperations(self._client, self._config, self._serialize, self._deserialize)
136+
self.updates = UpdatesOperations(self._client, self._config, self._serialize, self._deserialize)
119137

120-
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
138+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
121139
"""Runs the network request through the client's chained policies.
122140
123141
>>> from azure.core.rest import HttpRequest
@@ -137,12 +155,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
137155

138156
request_copy = deepcopy(request)
139157
request_copy.url = self._client.format_url(request_copy.url)
140-
return self._client.send_request(request_copy, **kwargs)
158+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
141159

142160
def close(self) -> None:
143161
self._client.close()
144162

145-
def __enter__(self) -> "AzureStackHCIClient":
163+
def __enter__(self) -> Self:
146164
self._client.__enter__()
147165
return self
148166

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
from typing import Any, TYPE_CHECKING
1010

11-
from azure.core.configuration import Configuration
1211
from azure.core.pipeline import policies
1312
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1413

@@ -19,24 +18,23 @@
1918
from azure.core.credentials import TokenCredential
2019

2120

22-
class AzureStackHCIClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
21+
class AzureStackHCIClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
2322
"""Configuration for AzureStackHCIClient.
2423
2524
Note that all parameters used to create this instance are saved as instance
2625
attributes.
2726
2827
:param credential: Credential needed for the client to connect to Azure. Required.
2928
:type credential: ~azure.core.credentials.TokenCredential
30-
:param subscription_id: The ID of the target subscription. Required.
29+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3130
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2023-09-01-preview". Note that overriding
33-
this default value may result in unsupported behavior.
31+
:keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this
32+
default value may result in unsupported behavior.
3433
:paramtype api_version: str
3534
"""
3635

3736
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
38-
super(AzureStackHCIClientConfiguration, self).__init__(**kwargs)
39-
api_version: str = kwargs.pop("api_version", "2023-09-01-preview")
37+
api_version: str = kwargs.pop("api_version", "2024-04-01")
4038

4139
if credential is None:
4240
raise ValueError("Parameter 'credential' must not be None.")
@@ -48,6 +46,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4846
self.api_version = api_version
4947
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
5048
kwargs.setdefault("sdk_moniker", "mgmt-azurestackhci/{}".format(VERSION))
49+
self.polling_interval = kwargs.get("polling_interval", 30)
5150
self._configure(**kwargs)
5251

5352
def _configure(self, **kwargs: Any) -> None:
@@ -56,9 +55,9 @@ def _configure(self, **kwargs: Any) -> None:
5655
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
5756
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
5857
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
59-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6058
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
6159
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
60+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6261
self.authentication_policy = kwargs.get("authentication_policy")
6362
if self.credential and not self.authentication_policy:
6463
self.authentication_policy = ARMChallengeAuthenticationPolicy(

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#
2626
# --------------------------------------------------------------------------
2727

28+
2829
# This file is used for handwritten extensions to the generated code. Example:
2930
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
3031
def patch_sdk():

0 commit comments

Comments
 (0)