Skip to content

Commit 6305163

Browse files
[AutoRelease] t2-hybridcompute-2024-04-18-02035(can only be merged by SDK owner) (#35260)
* code and test * Update assets.json --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent 568ed32 commit 6305163

File tree

92 files changed

+3569
-7286
lines changed

Some content is hidden

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

92 files changed

+3569
-7286
lines changed

sdk/hybridcompute/azure-mgmt-hybridcompute/CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
11
# Release History
22

3+
## 9.0.0b2 (2024-04-22)
4+
5+
### Features Added
6+
7+
- Added operation group MachineRunCommandsOperations
8+
- Model LicenseProfile has a new parameter billing_start_date
9+
- Model LicenseProfile has a new parameter disenrollment_date
10+
- Model LicenseProfile has a new parameter enrollment_date
11+
- Model LicenseProfile has a new parameter product_features
12+
- Model LicenseProfile has a new parameter product_type
13+
- Model LicenseProfile has a new parameter software_assurance_customer
14+
- Model LicenseProfile has a new parameter subscription_status
15+
- Model LicenseProfileMachineInstanceView has a new parameter billing_start_date
16+
- Model LicenseProfileMachineInstanceView has a new parameter disenrollment_date
17+
- Model LicenseProfileMachineInstanceView has a new parameter enrollment_date
18+
- Model LicenseProfileMachineInstanceView has a new parameter license_channel
19+
- Model LicenseProfileMachineInstanceView has a new parameter license_status
20+
- Model LicenseProfileMachineInstanceView has a new parameter product_features
21+
- Model LicenseProfileMachineInstanceView has a new parameter product_type
22+
- Model LicenseProfileMachineInstanceView has a new parameter software_assurance_customer
23+
- Model LicenseProfileMachineInstanceView has a new parameter subscription_status
24+
- Model LicenseProfileUpdate has a new parameter product_features
25+
- Model LicenseProfileUpdate has a new parameter product_type
26+
- Model LicenseProfileUpdate has a new parameter software_assurance_customer
27+
- Model LicenseProfileUpdate has a new parameter subscription_status
28+
- Model Machine has a new parameter os_edition
29+
30+
### Breaking Changes
31+
32+
- Removed operation group AgentVersionOperations
33+
- Removed operation group HybridIdentityMetadataOperations
34+
- Removed operation group LicenseProfilesOperations
35+
- Removed operation group LicensesOperations
36+
337
## 9.0.0b1 (2023-11-20)
438

539
### Features Added

sdk/hybridcompute/azure-mgmt-hybridcompute/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 Hybrid Compute 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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "11bbc2b1df2e915a2227a6a1a48a27b9e67c3311",
2+
"commit": "71a0c7adf2a6e169ab9a33c7cf36bb93db083e86",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.9.7",
55
"use": [
6-
"@autorest/python@6.7.1",
7-
"@autorest/modelerfour@4.26.2"
6+
"@autorest/python@6.13.7",
7+
"@autorest/modelerfour@4.27.0"
88
],
9-
"autorest_command": "autorest specification/hybridcompute/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",
9+
"autorest_command": "autorest specification/hybridcompute/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.13.7 --use=@autorest/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False",
1010
"readme": "specification/hybridcompute/resource-manager/readme.md"
1111
}

sdk/hybridcompute/azure-mgmt-hybridcompute/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "python",
44
"TagPrefix": "python/hybridcompute/azure-mgmt-hybridcompute",
5-
"Tag": "python/hybridcompute/azure-mgmt-hybridcompute_9bab93f309"
5+
"Tag": "python/hybridcompute/azure-mgmt-hybridcompute_4737bbece7"
66
}

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

Lines changed: 5 additions & 6 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,7 +18,7 @@
1918
from azure.core.credentials import TokenCredential
2019

2120

22-
class HybridComputeManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
21+
class HybridComputeManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
2322
"""Configuration for HybridComputeManagementClient.
2423
2524
Note that all parameters used to create this instance are saved as instance
@@ -29,14 +28,13 @@ class HybridComputeManagementClientConfiguration(Configuration): # pylint: disa
2928
:type credential: ~azure.core.credentials.TokenCredential
3029
:param subscription_id: The ID of the target subscription. Required.
3130
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2023-06-20-preview". Note that overriding
31+
:keyword api_version: Api Version. Default value is "2023-10-03-preview". Note that overriding
3332
this 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(HybridComputeManagementClientConfiguration, self).__init__(**kwargs)
39-
api_version: str = kwargs.pop("api_version", "2023-06-20-preview")
37+
api_version: str = kwargs.pop("api_version", "2023-10-03-preview")
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-hybridcompute/{}".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/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_hybrid_compute_management_client.py

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,19 @@
99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
1111

12+
from azure.core.pipeline import policies
1213
from azure.core.rest import HttpRequest, HttpResponse
1314
from azure.mgmt.core import ARMPipelineClient
15+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1416

1517
from . import models as _models
1618
from ._configuration import HybridComputeManagementClientConfiguration
1719
from ._serialization import Deserializer, Serializer
1820
from .operations import (
19-
AgentVersionOperations,
2021
ExtensionMetadataOperations,
2122
HybridComputeManagementClientOperationsMixin,
22-
HybridIdentityMetadataOperations,
23-
LicenseProfilesOperations,
24-
LicensesOperations,
2523
MachineExtensionsOperations,
24+
MachineRunCommandsOperations,
2625
MachinesOperations,
2726
NetworkProfileOperations,
2827
Operations,
@@ -41,12 +40,8 @@ class HybridComputeManagementClient(
4140
): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
4241
"""The Hybrid Compute Management Client.
4342
44-
:ivar licenses: LicensesOperations operations
45-
:vartype licenses: azure.mgmt.hybridcompute.operations.LicensesOperations
4643
:ivar machines: MachinesOperations operations
4744
:vartype machines: azure.mgmt.hybridcompute.operations.MachinesOperations
48-
:ivar license_profiles: LicenseProfilesOperations operations
49-
:vartype license_profiles: azure.mgmt.hybridcompute.operations.LicenseProfilesOperations
5045
:ivar machine_extensions: MachineExtensionsOperations operations
5146
:vartype machine_extensions: azure.mgmt.hybridcompute.operations.MachineExtensionsOperations
5247
:ivar extension_metadata: ExtensionMetadataOperations operations
@@ -55,11 +50,8 @@ class HybridComputeManagementClient(
5550
:vartype operations: azure.mgmt.hybridcompute.operations.Operations
5651
:ivar network_profile: NetworkProfileOperations operations
5752
:vartype network_profile: azure.mgmt.hybridcompute.operations.NetworkProfileOperations
58-
:ivar hybrid_identity_metadata: HybridIdentityMetadataOperations operations
59-
:vartype hybrid_identity_metadata:
60-
azure.mgmt.hybridcompute.operations.HybridIdentityMetadataOperations
61-
:ivar agent_version: AgentVersionOperations operations
62-
:vartype agent_version: azure.mgmt.hybridcompute.operations.AgentVersionOperations
53+
:ivar machine_run_commands: MachineRunCommandsOperations operations
54+
:vartype machine_run_commands: azure.mgmt.hybridcompute.operations.MachineRunCommandsOperations
6355
:ivar private_link_scopes: PrivateLinkScopesOperations operations
6456
:vartype private_link_scopes: azure.mgmt.hybridcompute.operations.PrivateLinkScopesOperations
6557
:ivar private_link_resources: PrivateLinkResourcesOperations operations
@@ -74,7 +66,7 @@ class HybridComputeManagementClient(
7466
:type subscription_id: str
7567
:param base_url: Service URL. Default value is "https://management.azure.com".
7668
:type base_url: str
77-
:keyword api_version: Api Version. Default value is "2023-06-20-preview". Note that overriding
69+
:keyword api_version: Api Version. Default value is "2023-10-03-preview". Note that overriding
7870
this default value may result in unsupported behavior.
7971
:paramtype api_version: str
8072
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -91,17 +83,31 @@ def __init__(
9183
self._config = HybridComputeManagementClientConfiguration(
9284
credential=credential, subscription_id=subscription_id, **kwargs
9385
)
94-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
86+
_policies = kwargs.pop("policies", None)
87+
if _policies is None:
88+
_policies = [
89+
policies.RequestIdPolicy(**kwargs),
90+
self._config.headers_policy,
91+
self._config.user_agent_policy,
92+
self._config.proxy_policy,
93+
policies.ContentDecodePolicy(**kwargs),
94+
ARMAutoResourceProviderRegistrationPolicy(),
95+
self._config.redirect_policy,
96+
self._config.retry_policy,
97+
self._config.authentication_policy,
98+
self._config.custom_hook_policy,
99+
self._config.logging_policy,
100+
policies.DistributedTracingPolicy(**kwargs),
101+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
102+
self._config.http_logging_policy,
103+
]
104+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
95105

96106
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
97107
self._serialize = Serializer(client_models)
98108
self._deserialize = Deserializer(client_models)
99109
self._serialize.client_side_validation = False
100-
self.licenses = LicensesOperations(self._client, self._config, self._serialize, self._deserialize)
101110
self.machines = MachinesOperations(self._client, self._config, self._serialize, self._deserialize)
102-
self.license_profiles = LicenseProfilesOperations(
103-
self._client, self._config, self._serialize, self._deserialize
104-
)
105111
self.machine_extensions = MachineExtensionsOperations(
106112
self._client, self._config, self._serialize, self._deserialize
107113
)
@@ -110,10 +116,9 @@ def __init__(
110116
)
111117
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
112118
self.network_profile = NetworkProfileOperations(self._client, self._config, self._serialize, self._deserialize)
113-
self.hybrid_identity_metadata = HybridIdentityMetadataOperations(
119+
self.machine_run_commands = MachineRunCommandsOperations(
114120
self._client, self._config, self._serialize, self._deserialize
115121
)
116-
self.agent_version = AgentVersionOperations(self._client, self._config, self._serialize, self._deserialize)
117122
self.private_link_scopes = PrivateLinkScopesOperations(
118123
self._client, self._config, self._serialize, self._deserialize
119124
)
@@ -124,7 +129,7 @@ def __init__(
124129
self._client, self._config, self._serialize, self._deserialize
125130
)
126131

127-
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
132+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
128133
"""Runs the network request through the client's chained policies.
129134
130135
>>> from azure.core.rest import HttpRequest
@@ -144,7 +149,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
144149

145150
request_copy = deepcopy(request)
146151
request_copy.url = self._client.format_url(request_copy.url)
147-
return self._client.send_request(request_copy, **kwargs)
152+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
148153

149154
def close(self) -> None:
150155
self._client.close()

0 commit comments

Comments
 (0)