Skip to content

Commit fd11a98

Browse files
[AutoRelease] t2-recoveryservicessiterecovery-2024-02-08-49614(can only be merged by SDK owner) (#34241)
* code and test * Update CHANGELOG.md --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent 51280f2 commit fd11a98

File tree

176 files changed

+714
-288
lines changed

Some content is hidden

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

176 files changed

+714
-288
lines changed

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

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

3+
## 1.2.0 (2024-02-22)
4+
5+
### Features Added
6+
7+
- Added operation ReplicationFabricsOperations.begin_remove_infra
8+
- Model A2AEnableProtectionInput has a new parameter auto_protection_of_data_disk
9+
310
## 1.1.0 (2023-09-15)
411

512
### Features Added

sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/README.md

Lines changed: 2 additions & 5 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 Recovery Services Site Recovery 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
@@ -59,6 +59,3 @@ Code samples for this package can be found at:
5959
If you encounter any bugs or have suggestions, please file an issue in the
6060
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
6161
section of the project.
62-
63-
64-
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-recoveryservicessiterecovery%2FREADME.png)

sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/_meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"commit": "a29126ca8200a6c981a4e908e41fe55730df4cad",
2+
"commit": "a4d405de616be574891325c48a08298f60e6692b",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.9.7",
55
"use": [

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class SiteRecoveryManagementClientConfiguration(Configuration): # pylint: disab
3434
:type resource_group_name: str
3535
:param resource_name: The name of the recovery services vault. Required.
3636
:type resource_name: str
37-
:keyword api_version: Api Version. Default value is "2023-06-01". Note that overriding this
37+
:keyword api_version: Api Version. Default value is "2023-08-01". Note that overriding this
3838
default value may result in unsupported behavior.
3939
:paramtype api_version: str
4040
"""
@@ -48,7 +48,7 @@ def __init__(
4848
**kwargs: Any
4949
) -> None:
5050
super(SiteRecoveryManagementClientConfiguration, self).__init__(**kwargs)
51-
api_version: str = kwargs.pop("api_version", "2023-06-01")
51+
api_version: str = kwargs.pop("api_version", "2023-08-01")
5252

5353
if credential is None:
5454
raise ValueError("Parameter 'credential' must not be None.")

sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/_site_recovery_management_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class SiteRecoveryManagementClient: # pylint: disable=client-accepts-api-versio
152152
:type resource_name: str
153153
:param base_url: Service URL. Default value is "https://management.azure.com".
154154
:type base_url: str
155-
:keyword api_version: Api Version. Default value is "2023-06-01". Note that overriding this
155+
:keyword api_version: Api Version. Default value is "2023-08-01". Note that overriding this
156156
default value may result in unsupported behavior.
157157
:paramtype api_version: str
158158
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no

sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "1.1.0"
9+
VERSION = "1.2.0"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class SiteRecoveryManagementClientConfiguration(Configuration): # pylint: disab
3434
:type resource_group_name: str
3535
:param resource_name: The name of the recovery services vault. Required.
3636
:type resource_name: str
37-
:keyword api_version: Api Version. Default value is "2023-06-01". Note that overriding this
37+
:keyword api_version: Api Version. Default value is "2023-08-01". Note that overriding this
3838
default value may result in unsupported behavior.
3939
:paramtype api_version: str
4040
"""
@@ -48,7 +48,7 @@ def __init__(
4848
**kwargs: Any
4949
) -> None:
5050
super(SiteRecoveryManagementClientConfiguration, self).__init__(**kwargs)
51-
api_version: str = kwargs.pop("api_version", "2023-06-01")
51+
api_version: str = kwargs.pop("api_version", "2023-08-01")
5252

5353
if credential is None:
5454
raise ValueError("Parameter 'credential' must not be None.")

sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/_site_recovery_management_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class SiteRecoveryManagementClient: # pylint: disable=client-accepts-api-versio
152152
:type resource_name: str
153153
:param base_url: Service URL. Default value is "https://management.azure.com".
154154
:type base_url: str
155-
:keyword api_version: Api Version. Default value is "2023-06-01". Note that overriding this
155+
:keyword api_version: Api Version. Default value is "2023-08-01". Note that overriding this
156156
default value may result in unsupported behavior.
157157
:paramtype api_version: str
158158
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no

sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_fabrics_operations.py

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
build_migrate_to_aad_request,
4141
build_purge_request,
4242
build_reassociate_gateway_request,
43+
build_remove_infra_request,
4344
build_renew_certificate_request,
4445
)
4546

@@ -1305,3 +1306,120 @@ def get_long_running_output(pipeline_response):
13051306
begin_renew_certificate.metadata = {
13061307
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/renewCertificate"
13071308
}
1309+
1310+
async def _remove_infra_initial( # pylint: disable=inconsistent-return-statements
1311+
self, resource_name: str, fabric_name: str, **kwargs: Any
1312+
) -> None:
1313+
error_map = {
1314+
401: ClientAuthenticationError,
1315+
404: ResourceNotFoundError,
1316+
409: ResourceExistsError,
1317+
304: ResourceNotModifiedError,
1318+
}
1319+
error_map.update(kwargs.pop("error_map", {}) or {})
1320+
1321+
_headers = kwargs.pop("headers", {}) or {}
1322+
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1323+
1324+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
1325+
cls: ClsType[None] = kwargs.pop("cls", None)
1326+
1327+
request = build_remove_infra_request(
1328+
resource_name=resource_name,
1329+
fabric_name=fabric_name,
1330+
resource_group_name=self._config.resource_group_name,
1331+
subscription_id=self._config.subscription_id,
1332+
api_version=api_version,
1333+
template_url=self._remove_infra_initial.metadata["url"],
1334+
headers=_headers,
1335+
params=_params,
1336+
)
1337+
request = _convert_request(request)
1338+
request.url = self._client.format_url(request.url)
1339+
1340+
_stream = False
1341+
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
1342+
request, stream=_stream, **kwargs
1343+
)
1344+
1345+
response = pipeline_response.http_response
1346+
1347+
if response.status_code not in [202]:
1348+
map_error(status_code=response.status_code, response=response, error_map=error_map)
1349+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
1350+
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
1351+
1352+
response_headers = {}
1353+
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
1354+
1355+
if cls:
1356+
return cls(pipeline_response, None, response_headers)
1357+
1358+
_remove_infra_initial.metadata = {
1359+
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/removeInfra"
1360+
}
1361+
1362+
@distributed_trace_async
1363+
async def begin_remove_infra(self, resource_name: str, fabric_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
1364+
"""Removes the appliance's infrastructure under the fabric.
1365+
1366+
Removes the appliance's infrastructure under the fabric.
1367+
1368+
:param resource_name: Resource name. Required.
1369+
:type resource_name: str
1370+
:param fabric_name: Fabric name. Required.
1371+
:type fabric_name: str
1372+
:keyword callable cls: A custom type or function that will be passed the direct response
1373+
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
1374+
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
1375+
this operation to not poll, or pass in your own initialized polling object for a personal
1376+
polling strategy.
1377+
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
1378+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
1379+
Retry-After header is present.
1380+
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
1381+
:rtype: ~azure.core.polling.AsyncLROPoller[None]
1382+
:raises ~azure.core.exceptions.HttpResponseError:
1383+
"""
1384+
_headers = kwargs.pop("headers", {}) or {}
1385+
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1386+
1387+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
1388+
cls: ClsType[None] = kwargs.pop("cls", None)
1389+
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
1390+
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
1391+
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
1392+
if cont_token is None:
1393+
raw_result = await self._remove_infra_initial( # type: ignore
1394+
resource_name=resource_name,
1395+
fabric_name=fabric_name,
1396+
api_version=api_version,
1397+
cls=lambda x, y, z: x,
1398+
headers=_headers,
1399+
params=_params,
1400+
**kwargs
1401+
)
1402+
kwargs.pop("error_map", None)
1403+
1404+
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
1405+
if cls:
1406+
return cls(pipeline_response, None, {})
1407+
1408+
if polling is True:
1409+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
1410+
elif polling is False:
1411+
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
1412+
else:
1413+
polling_method = polling
1414+
if cont_token:
1415+
return AsyncLROPoller.from_continuation_token(
1416+
polling_method=polling_method,
1417+
continuation_token=cont_token,
1418+
client=self._client,
1419+
deserialization_callback=get_long_running_output,
1420+
)
1421+
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
1422+
1423+
begin_remove_infra.metadata = {
1424+
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/removeInfra"
1425+
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@
113113
from ._models_py3 import EnableProtectionInputProperties
114114
from ._models_py3 import EnableProtectionProviderSpecificInput
115115
from ._models_py3 import EncryptionDetails
116+
from ._models_py3 import ErrorAdditionalInfo
117+
from ._models_py3 import ErrorDetail
118+
from ._models_py3 import ErrorResponse
116119
from ._models_py3 import Event
117120
from ._models_py3 import EventCollection
118121
from ._models_py3 import EventProperties
@@ -690,6 +693,9 @@
690693
"EnableProtectionInputProperties",
691694
"EnableProtectionProviderSpecificInput",
692695
"EncryptionDetails",
696+
"ErrorAdditionalInfo",
697+
"ErrorDetail",
698+
"ErrorResponse",
693699
"Event",
694700
"EventCollection",
695701
"EventProperties",

0 commit comments

Comments
 (0)