Skip to content

Commit b2b68be

Browse files
[AutoRelease] t2-recoveryservices-2025-09-29-72087(can only be merged by SDK owner) (#43169)
* code and test * Update CHANGELOG.md * Update CHANGELOG.md --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent 73c1684 commit b2b68be

File tree

87 files changed

+12657
-504
lines changed

Some content is hidden

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

87 files changed

+12657
-504
lines changed

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

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

3+
## 4.0.0 (2025-09-29)
4+
5+
### Features Added
6+
7+
- Model `RecoveryServicesClient` added parameter `cloud_setting` in method `__init__`
8+
- Client `RecoveryServicesClient` added method `send_request`
9+
- Client `RecoveryServicesClient` added operation group `deleted_vaults`
10+
- Model `PatchTrackedResource` added property `system_data`
11+
- Model `PatchVault` added property `system_data`
12+
- Model `PrivateLinkResource` added property `system_data`
13+
- Model `Resource` added property `system_data`
14+
- Model `TrackedResource` added property `system_data`
15+
- Model `VaultExtendedInfoResource` added property `properties`
16+
- Model `VaultExtendedInfoResource` added property `system_data`
17+
- Added model `CloudError`
18+
- Added model `DeletedVault`
19+
- Added model `DeletedVaultProperties`
20+
- Added model `DeletedVaultUndeleteInput`
21+
- Added model `DeletedVaultUndeleteInputProperties`
22+
- Added model `ProxyResource`
23+
- Added model `VaultExtendedInfo`
24+
- Added operation group `DeletedVaultsOperations`
25+
26+
### Breaking Changes
27+
28+
- This version introduces new hybrid models which have dual dictionary and model nature. And please follow https://aka.ms/azsdk/python/migrate/hybrid-models for migration.
29+
- Model `Resource` deleted or renamed its instance variable `etag`
30+
- Model `TrackedResource` deleted or renamed its instance variable `etag`
31+
- Model `VaultExtendedInfoResource` deleted or renamed its instance variable `integrity_key`
32+
- Model `VaultExtendedInfoResource` deleted or renamed its instance variable `encryption_key`
33+
- Model `VaultExtendedInfoResource` deleted or renamed its instance variable `encryption_key_thumbprint`
34+
- Model `VaultExtendedInfoResource` deleted or renamed its instance variable `algorithm`
35+
- Deleted or renamed model `ClientDiscoveryResponse`
36+
- Deleted or renamed model `PrivateLinkResources`
37+
- Deleted or renamed model `ReplicationUsageList`
38+
- Deleted or renamed model `VaultList`
39+
- Deleted or renamed model `VaultUsageList`
40+
- Method `VaultsOperations.begin_create_or_update` changed its parameter `x_ms_authorization_auxiliary` from `positional_or_keyword` to `keyword_only`
41+
- Method `VaultsOperations.begin_update` changed its parameter `x_ms_authorization_auxiliary` from `positional_or_keyword` to `keyword_only`
42+
- Deleted or renamed operation group `RecoveryServicesClientOperationsMixin`
43+
344
## 3.1.0 (2025-06-03)
445

546
### Features Added
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
recursive-include tests *.py *.json
2-
recursive-include samples *.py *.md
31
include *.md
4-
include azure/__init__.py
5-
include azure/mgmt/__init__.py
62
include LICENSE
73
include azure/mgmt/recoveryservices/py.typed
4+
recursive-include tests *.py
5+
recursive-include samples *.py *.md
6+
include azure/__init__.py
7+
include azure/mgmt/__init__.py
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
2-
"commit": "fabce2fda4c20dfddbba4a265163ecb5b3ad117b",
2+
"apiVersion": "2025-08-01",
3+
"commit": "348e0ea05f4f5cac81567e4d3cf3a780e17604f8",
34
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.10.2",
5-
"use": [
6-
"@autorest/[email protected]",
7-
"@autorest/[email protected]"
8-
],
9-
"autorest_command": "autorest specification/recoveryservices/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
10-
"readme": "specification/recoveryservices/resource-manager/readme.md"
5+
"typespec_src": "specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/RecoveryServices",
6+
"emitterVersion": "0.51.2"
117
}

sdk/recoveryservices/azure-mgmt-recoveryservices/apiview-properties.json

Lines changed: 150 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore

sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88
# pylint: disable=wrong-import-position
@@ -12,7 +12,7 @@
1212
if TYPE_CHECKING:
1313
from ._patch import * # pylint: disable=unused-wildcard-import
1414

15-
from ._recovery_services_client import RecoveryServicesClient # type: ignore
15+
from ._client import RecoveryServicesClient # type: ignore
1616
from ._version import VERSION
1717

1818
__version__ = VERSION
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) Python Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from copy import deepcopy
10+
from typing import Any, Optional, TYPE_CHECKING, cast
11+
from typing_extensions import Self
12+
13+
from azure.core.pipeline import policies
14+
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
16+
from azure.mgmt.core import ARMPipelineClient
17+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
19+
20+
from ._configuration import RecoveryServicesClientConfiguration
21+
from ._utils.serialization import Deserializer, Serializer
22+
from .operations import (
23+
DeletedVaultsOperations,
24+
Operations,
25+
PrivateLinkResourcesOperations,
26+
RecoveryServicesOperations,
27+
RegisteredIdentitiesOperations,
28+
ReplicationUsagesOperations,
29+
UsagesOperations,
30+
VaultCertificatesOperations,
31+
VaultExtendedInfoOperations,
32+
VaultsOperations,
33+
_RecoveryServicesClientOperationsMixin,
34+
)
35+
36+
if TYPE_CHECKING:
37+
from azure.core import AzureClouds
38+
from azure.core.credentials import TokenCredential
39+
40+
41+
class RecoveryServicesClient(_RecoveryServicesClientOperationsMixin): # pylint: disable=too-many-instance-attributes
42+
"""RecoveryServicesClient.
43+
44+
:ivar operations: Operations operations
45+
:vartype operations: azure.mgmt.recoveryservices.operations.Operations
46+
:ivar vaults: VaultsOperations operations
47+
:vartype vaults: azure.mgmt.recoveryservices.operations.VaultsOperations
48+
:ivar deleted_vaults: DeletedVaultsOperations operations
49+
:vartype deleted_vaults: azure.mgmt.recoveryservices.operations.DeletedVaultsOperations
50+
:ivar private_link_resources: PrivateLinkResourcesOperations operations
51+
:vartype private_link_resources:
52+
azure.mgmt.recoveryservices.operations.PrivateLinkResourcesOperations
53+
:ivar vault_certificates: VaultCertificatesOperations operations
54+
:vartype vault_certificates: azure.mgmt.recoveryservices.operations.VaultCertificatesOperations
55+
:ivar registered_identities: RegisteredIdentitiesOperations operations
56+
:vartype registered_identities:
57+
azure.mgmt.recoveryservices.operations.RegisteredIdentitiesOperations
58+
:ivar replication_usages: ReplicationUsagesOperations operations
59+
:vartype replication_usages: azure.mgmt.recoveryservices.operations.ReplicationUsagesOperations
60+
:ivar usages: UsagesOperations operations
61+
:vartype usages: azure.mgmt.recoveryservices.operations.UsagesOperations
62+
:ivar vault_extended_info: VaultExtendedInfoOperations operations
63+
:vartype vault_extended_info:
64+
azure.mgmt.recoveryservices.operations.VaultExtendedInfoOperations
65+
:ivar recovery_services: RecoveryServicesOperations operations
66+
:vartype recovery_services: azure.mgmt.recoveryservices.operations.RecoveryServicesOperations
67+
:param credential: Credential used to authenticate requests to the service. Required.
68+
:type credential: ~azure.core.credentials.TokenCredential
69+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
70+
:type subscription_id: str
71+
:param base_url: Service host. Default value is None.
72+
:type base_url: str
73+
:keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
74+
None.
75+
:paramtype cloud_setting: ~azure.core.AzureClouds
76+
:keyword api_version: The API version to use for this operation. Default value is "2025-08-01".
77+
Note that overriding this default value may result in unsupported behavior.
78+
:paramtype api_version: str
79+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
80+
Retry-After header is present.
81+
"""
82+
83+
def __init__(
84+
self,
85+
credential: "TokenCredential",
86+
subscription_id: str,
87+
base_url: Optional[str] = None,
88+
*,
89+
cloud_setting: Optional["AzureClouds"] = None,
90+
**kwargs: Any
91+
) -> None:
92+
_endpoint = "{endpoint}"
93+
_cloud = cloud_setting or settings.current.azure_cloud # type: ignore
94+
_endpoints = get_arm_endpoints(_cloud)
95+
if not base_url:
96+
base_url = _endpoints["resource_manager"]
97+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
98+
self._config = RecoveryServicesClientConfiguration(
99+
credential=credential,
100+
subscription_id=subscription_id,
101+
base_url=cast(str, base_url),
102+
cloud_setting=cloud_setting,
103+
credential_scopes=credential_scopes,
104+
**kwargs
105+
)
106+
107+
_policies = kwargs.pop("policies", None)
108+
if _policies is None:
109+
_policies = [
110+
policies.RequestIdPolicy(**kwargs),
111+
self._config.headers_policy,
112+
self._config.user_agent_policy,
113+
self._config.proxy_policy,
114+
policies.ContentDecodePolicy(**kwargs),
115+
ARMAutoResourceProviderRegistrationPolicy(),
116+
self._config.redirect_policy,
117+
self._config.retry_policy,
118+
self._config.authentication_policy,
119+
self._config.custom_hook_policy,
120+
self._config.logging_policy,
121+
policies.DistributedTracingPolicy(**kwargs),
122+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
123+
self._config.http_logging_policy,
124+
]
125+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)
126+
127+
self._serialize = Serializer()
128+
self._deserialize = Deserializer()
129+
self._serialize.client_side_validation = False
130+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
131+
self.vaults = VaultsOperations(self._client, self._config, self._serialize, self._deserialize)
132+
self.deleted_vaults = DeletedVaultsOperations(self._client, self._config, self._serialize, self._deserialize)
133+
self.private_link_resources = PrivateLinkResourcesOperations(
134+
self._client, self._config, self._serialize, self._deserialize
135+
)
136+
self.vault_certificates = VaultCertificatesOperations(
137+
self._client, self._config, self._serialize, self._deserialize
138+
)
139+
self.registered_identities = RegisteredIdentitiesOperations(
140+
self._client, self._config, self._serialize, self._deserialize
141+
)
142+
self.replication_usages = ReplicationUsagesOperations(
143+
self._client, self._config, self._serialize, self._deserialize
144+
)
145+
self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize)
146+
self.vault_extended_info = VaultExtendedInfoOperations(
147+
self._client, self._config, self._serialize, self._deserialize
148+
)
149+
self.recovery_services = RecoveryServicesOperations(
150+
self._client, self._config, self._serialize, self._deserialize
151+
)
152+
153+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
154+
"""Runs the network request through the client's chained policies.
155+
156+
>>> from azure.core.rest import HttpRequest
157+
>>> request = HttpRequest("GET", "https://www.example.org/")
158+
<HttpRequest [GET], url: 'https://www.example.org/'>
159+
>>> response = client.send_request(request)
160+
<HttpResponse: 200 OK>
161+
162+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
163+
164+
:param request: The network request you want to make. Required.
165+
:type request: ~azure.core.rest.HttpRequest
166+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
167+
:return: The response of your network call. Does not do error handling on your response.
168+
:rtype: ~azure.core.rest.HttpResponse
169+
"""
170+
171+
request_copy = deepcopy(request)
172+
path_format_arguments = {
173+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
174+
}
175+
176+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
177+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
178+
179+
def close(self) -> None:
180+
self._client.close()
181+
182+
def __enter__(self) -> Self:
183+
self._client.__enter__()
184+
return self
185+
186+
def __exit__(self, *exc_details: Any) -> None:
187+
self._client.__exit__(*exc_details)

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

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from typing import Any, TYPE_CHECKING
9+
from typing import Any, Optional, TYPE_CHECKING
1010

1111
from azure.core.pipeline import policies
1212
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1313

1414
from ._version import VERSION
1515

1616
if TYPE_CHECKING:
17+
from azure.core import AzureClouds
1718
from azure.core.credentials import TokenCredential
1819

1920

@@ -23,17 +24,29 @@ class RecoveryServicesClientConfiguration: # pylint: disable=too-many-instance-
2324
Note that all parameters used to create this instance are saved as instance
2425
attributes.
2526
26-
:param credential: Credential needed for the client to connect to Azure. Required.
27+
:param credential: Credential used to authenticate requests to the service. Required.
2728
:type credential: ~azure.core.credentials.TokenCredential
28-
: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.
2930
:type subscription_id: str
30-
:keyword api_version: Api Version. Default value is "2025-02-01". Note that overriding this
31-
default value may result in unsupported behavior.
31+
:param base_url: Service host. Default value is "https://management.azure.com".
32+
:type base_url: str
33+
:param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
34+
None.
35+
:type cloud_setting: ~azure.core.AzureClouds
36+
:keyword api_version: The API version to use for this operation. Default value is "2025-08-01".
37+
Note that overriding this default value may result in unsupported behavior.
3238
:paramtype api_version: str
3339
"""
3440

35-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
36-
api_version: str = kwargs.pop("api_version", "2025-02-01")
41+
def __init__(
42+
self,
43+
credential: "TokenCredential",
44+
subscription_id: str,
45+
base_url: str = "https://management.azure.com",
46+
cloud_setting: Optional["AzureClouds"] = None,
47+
**kwargs: Any
48+
) -> None:
49+
api_version: str = kwargs.pop("api_version", "2025-08-01")
3750

3851
if credential is None:
3952
raise ValueError("Parameter 'credential' must not be None.")
@@ -42,6 +55,8 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4255

4356
self.credential = credential
4457
self.subscription_id = subscription_id
58+
self.base_url = base_url
59+
self.cloud_setting = cloud_setting
4560
self.api_version = api_version
4661
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4762
kwargs.setdefault("sdk_moniker", "mgmt-recoveryservices/{}".format(VERSION))
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# --------------------------------------------------------------------------
22
# Copyright (c) Microsoft Corporation. All rights reserved.
33
# Licensed under the MIT License. See License.txt in the project root for license information.
4-
# Code generated by Microsoft (R) AutoRest Code Generator.
4+
# Code generated by Microsoft (R) Python Code Generator.
55
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
66
# --------------------------------------------------------------------------

0 commit comments

Comments
 (0)